https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
rx
  • z

    zak.taccardi

    02/02/2017, 8:56 PM
    how do you guys expose a click event as an observable from within a
    ViewHolder
    within
    RecyclerView
    ? Would it be bad form to use a `Subject`/`Relay` (that's scoped to the containing ViewGroup/Fragment/Activity), which the
    ViewHolder
    has a reference to?
    b
    1 reply · 2 participants
  • z

    zak.taccardi

    02/13/2017, 5:12 PM
    how can RxJava v2 throw an exception to be handled imperatively? Is it possible? I'm current getting a fatal
    ERR: stack=java.lang.NullPointerException: subscribeActual failed
    @Throws(Throwable::class)
        override fun onRun() {
                  //synchronous stream....
                    .subscribe(
                            {},
                            { throw it } //I need this exception to be thrown to the wrapping `onRun` method
                    )
        }
    z
    1 reply · 2 participants
  • k

    karolkowalski

    02/24/2017, 12:19 PM
    Should it really behave like that?
    @Test fun shouldBlowYourMind() {
        Observable.empty<Unit>().test().assertEmpty()
    }
    java.lang.AssertionError: Completed! (latch = 0, values = 0, errors = 0, completions = 1)
    a
    b
    6 replies · 3 participants
  • d

    d.medina

    03/07/2017, 6:47 PM
    what was changed with rxkotlin 1.0.0-RC2?
    a
    2 replies · 2 participants
  • g

    gvoltr

    03/12/2017, 2:36 PM
    Hello guys, can please someone explain me why using rxJava2 I have next situation: Using java Observable.fromArray(new String[]{"one", "two", “three”}) emit strings one by one Using kotlin Observable.fromArray(arrayOf("one", "two", “three”)) emit one element - array of strings
    m
    1 reply · 2 participants
  • j

    jw

    03/16/2017, 10:21 PM
    networkLoad()
        .subscribeOn(io())
        .startWith(cacheCompute())
        .subscribeOn(computation())
        .observeOn(mainThread())
    👍 2
    m
    1 reply · 2 participants
  • a

    anstaendig

    03/20/2017, 6:09 PM
    What’s the point of the ‘observation’ here
    z
    r
    42 replies · 3 participants
  • z

    zak.taccardi

    03/21/2017, 11:23 PM
    albeit slower test runs, but you would get more code coverage
    g
    7 replies · 2 participants
  • k

    kiwiandroiddev

    03/22/2017, 12:00 AM
    Extracted this out into a function that seems to work OK (for the 3 source observable variant anyway):
    fun <T1, T2, T3, R> asyncCombineLatest(o1: Observable<T1>,
                                                       o2: Observable<T2>,
                                                       o3: Observable<T3>,
                                                       asyncCombineFunc: (T1, T2, T3) -> Observable<R>): Observable<R> =
                Observable.combineLatest(o1, o2, o3) { a, b, c -> Triple(a, b, c) }
                        .flatMap { bundle ->
                            val (a, b, c) = bundle
                            asyncCombineFunc(a, b, c)
                        }
    m
    a
    6 replies · 3 participants
  • n

    nitrog42

    03/23/2017, 5:16 PM
    but the output is still the same : trying value Thu Mar 23 18:15:08 CET 2017 trying value Thu Mar 23 18:15:10 CET 2017 trying value Thu Mar 23 18:15:12 CET 2017 3 true because the 5 seconds timeout start only after the first emission (18:15:08). If I return true at the 4th iteration, the timeout will occurs, at 18:15:13
    b
    9 replies · 2 participants
  • z

    zak.taccardi

    03/23/2017, 7:49 PM
    not everything has to be rx
    👍 2
    n
    1 reply · 2 participants
  • d

    damian

    03/23/2017, 10:13 PM
    edit: never mind I'm bad at reading
    m
    1 reply · 2 participants
  • v

    vincentm

    03/30/2017, 8:34 AM
    (to be honest, I like the way DisposeOnDestroy works, maybe I will change my code to integrate a similar behavior)
    m
    5 replies · 2 participants
  • m

    mutexkid

    03/30/2017, 8:05 PM
    does it make sense to combine them?
    e
    2 replies · 2 participants
  • m

    mg6maciej

    04/02/2017, 11:01 AM
    https://www.lightbend.com/blog/lightbend-introduces-retro-a-synchronous-blocking-jvm-framework-for-building-mega-monoliths-one-chunk-at-a-time
    p
    1 reply · 2 participants
  • b

    borboss

    04/04/2017, 12:52 PM
    Hello! I tried to play with this example - https://github.com/thomasnield/rxkotlinfx-tornadofx-demo . Using RxJava-JDBC by David Moten. Got a question. If i throw an exception in a Rx query to the database, when I try to make a query after the exception was thrown, database will return me an empty observable. How can I make it work again after an exception was throws? .flatMap { if(it.size == 0 || enabled) { forId(id) } else { throw Exception("Cannon disable. There are people with this profile") } }
    p
    a
    +1
    14 replies · 4 participants
  • b

    bulwinkel

    04/05/2017, 9:26 AM
    with the announcement of kotlin/native, what are peoples opinions on how to deal with rx across multiple platform targets?
    d
    1 reply · 2 participants
  • b

    bulwinkel

    04/05/2017, 10:32 AM
    reimplementing RxJava seems like an epic task
    e
    2 replies · 2 participants
  • a

    anstaendig

    04/05/2017, 10:45 AM
    Is it a common pattern to use Subjects to cache an observables emission? Like using a BehaviourSubject to cache the last item emitted? To me it somewhat feels like a misuse if I only have one subscriber. Is it just me?
    t
    l
    4 replies · 3 participants
  • j

    jw

    04/05/2017, 2:11 PM
    Subjects are always the wrong answer!
    ❤️ 1
    a
    b
    2 replies · 3 participants
  • m

    Marc

    04/09/2017, 5:14 PM
    which is the current version of rxkotlin2 ?
    t
    1 reply · 2 participants
  • l

    lupajz

    04/11/2017, 9:43 AM
    Question. If I pass in Dispossable into CompositeDisposable if the termination event happens is the given dispossable evicted or still present ?
    p
    2 replies · 2 participants
  • m

    mingkangpan

    04/12/2017, 9:51 PM
    oaky, I got the issue, since rxbinding never calls onComplete,
    groupby
    can never work, fortunately I herad this in some presentation that groupby require onComple to get called by previous observables, but where is this documented?
    t
    p
    6 replies · 3 participants
  • a

    aballano

    04/12/2017, 9:55 PM
    but is true that it should be better documented. Unless you already had an issue with that you might not guess it
    😕 1
    t
    p
    6 replies · 3 participants
  • r

    rwachol

    04/14/2017, 5:56 AM
    Hi everyone, I’m about to move from rx1 to rx2. I’ve read this https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0 and used rx2 before but it seems that I can stay with Observable type (android) and just move dependencies (retrofit) to rx2. Is there anything I should know before moving ?
    p
    6 replies · 2 participants
  • z

    zak.taccardi

    04/19/2017, 3:28 PM
    val intentions = ui.intentions()
                    .map {
                        fun handleUiInput(intention: Intention): Unit = when (intention) {
                            is Intention.BooleanPreferenceWithChange -> {
                                intention.preference.db.set(newValue = intention.change)
                            }
                            is Intention.NumberPreferenceWithChange -> {
                                taxDb.write(intention.change)
                            }
                        }
                        handleUiInput(it)
                    }
    is there any better way to do a compile time type-safe
    when
    over a
    sealed class
    in an rx stream?
    ➕ 1
    p
    l
    6 replies · 3 participants
  • j

    jw

    04/20/2017, 5:58 PM
    I don't know. I'm mobile, but that logic can be encapsulated by operators. A subject/relay is just a bridge to imperative sources which is orthogonal to the desire to cache the most recent value to be replayed to the first subscriber
    m
    z
    3 replies · 3 participants
  • e

    elizarov

    04/20/2017, 7:35 PM
    If you start with reactive stream spec interfaces http://www.reactive-streams.org/ and throw in
    kotlinx-coroutines-reactive
    module, then actually writing all the Rx operators becomes quite a trivial endeavor. See here for details: https://github.com/Kotlin/kotlinx.coroutines/blob/master/reactive/coroutines-guide-reactive.md#operators
    t
    1 reply · 2 participants
  • t

    thomasnield

    04/28/2017, 1:30 AM
    @mg6maciej you have an eye for subtle code nuances. Any ideas?
    m
    b
    8 replies · 3 participants
  • j

    johnl

    04/30/2017, 12:18 PM
    I have been using it everywhere, but sometimes I look back and ask why
    t
    6 replies · 2 participants
Powered by Linen
Title
j

johnl

04/30/2017, 12:18 PM
I have been using it everywhere, but sometimes I look back and ask why
t

thomasnield

04/30/2017, 3:14 PM
billy: that's interesting because I have observed the opposite. Unless you are using a lot of blocking, subjects, and breaking monads, I've found Rx to eliminate boilerplate quite a bit.
j

johnl

05/01/2017, 8:46 AM
Well there is a point there I admit, but I generate alot of client code for android and ios and service to service clients, I always generate it with calls returning observables, because I want combinability in everything.
In the end its 80-20 only 20 percent of calls are ever really combined, but so be it, I cant design that up front.
But the boilerpplate I was really mentioning is the addition of things like MVVM
In the end I could code in simple forms and such about the same thing in less code, heck I have been doing it for 20 years.
The operator head scratching and extra code for MVVM seems like its unnecessary for many things, I am trying to find the optimal amount of rx in an application but for now Im kind of shotgunning it everywhere to see where I feel its not really needed later
View count: 2