https://kotlinlang.org logo
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
  • e

    elizarov

    05/03/2018, 2:14 PM
    You can apply backpressure implicitly, though, even to Rx2 observable. The longer you take to process the observed items, the more you block the producer. So, if producer is just a loop, then it will be able to emit only as many items per second as observer is able to process.
    u
    • 2
    • 2
  • j

    jw

    05/04/2018, 2:25 PM
    you create a callback which receives an emitter that you can pipe information into as it's given to you
    u
    • 2
    • 3
  • z

    zak.taccardi

    05/07/2018, 9:33 PM
    I think misusing Rx’s
    onError()
    to pass expected error information is one of the biggest mistakes people make https://medium.com/@ZakTaccardi/api-design-handling-exceptions-84a143e32232
    b
    • 2
    • 1
  • u

    ursus

    05/07/2018, 11:57 PM
    do you have opionion on that?
    z
    • 2
    • 28
  • o

    oday

    05/08/2018, 11:07 AM
    why does line 6 get called multiple times? https://pastebin.com/tz0gkZrg
    l
    • 2
    • 6
  • p

    Paul Woitaschek

    05/11/2018, 8:33 AM
    use the flatMap instead of the second map
    😀 1
    u
    • 2
    • 3
  • d

    Daniel

    05/16/2018, 6:25 AM
    Hey guys, I am making a library for Android which would later be made available via maven. I want to make an optional library which can be added to the project and would work with the original main library to give
    Rx support
    as I do not want to increase the original library’s method count. This is similar to how you can add optional
    Rx support
    to
    Retrofit
    and Retrofit can work with
    Rxjava
    . I tried finding ways to do it but without results. Can anyone who has worked on it help me out on how to set it up? Maybe some code examples or websites on how to do it?
    g
    m
    u
    • 4
    • 8
  • l

    leosan

    05/17/2018, 3:12 PM
    object Main {
    
        val items = Observable.just("a")
        val test = items
                .repeatWhen { it.concatMap { Observable.timer(1, TimeUnit.SECONDS) } }
        val exec = CompositeDisposable()
    
        @JvmStatic
        fun main(args: Array<String>) {
    
            exec.add(test
                    .subscribe {
                        print(it)
                    })
            Thread.sleep(5000)
            exec.dispose()
            exec.add(test
                    .subscribe {
                        print(it)
                    })
            Thread.sleep(5000)
    
        }
    }
    Why after disposing the first time, it only subscribe once? The first time prints fine five times
    a
    but after the dispose it runs only once
    • 1
    • 1
  • m

    memphis

    05/22/2018, 12:29 PM
    Hello guys 🙂 I hope someone can give me a hint .. I’m working on a simple weather app .. Once I get data from the API I want to store it using Realm and call a method to fetch data from the database. But the problem is that the method for fetching from db is called before the data are saved into Realm, so I get this : E/LandingViewModel: onError with :java.util.NoSuchElementException: List is empty.
    g
    g
    • 3
    • 4
  • j

    jw

    05/25/2018, 1:43 PM
    you should not be implementing a disposable with a lambda
    u
    • 2
    • 4
  • p

    Paul Woitaschek

    05/28/2018, 6:23 PM
    runBlocking @aeruhxi
    a
    a
    g
    • 4
    • 4
  • a

    arekolek

    05/30/2018, 10:36 AM
    What's worse, Intellij gives you an intention action to convert former to the latter, I filed an issue about this https://youtrack.jetbrains.net/issue/IDEA-192952
    g
    • 2
    • 2
  • a

    adams2

    05/31/2018, 6:25 PM
    anyone have opinions on using onDetachedFromWindow vs onStop to unsubscribe from a hot observable? onDetachedFromWindow looks like it gets used pretty often but it feels weird to me to have your app doing work when you might have pressed Home.
    • 1
    • 1
  • j

    jw

    06/13/2018, 7:35 PM
    .toObservable()
    k
    • 2
    • 2
  • j

    Jacob Applin

    06/28/2018, 12:27 PM
    Is there an active project to create an RxKotlin which can be used for multiplatform?
    l
    s
    • 3
    • 6
  • b

    blakelee

    06/28/2018, 9:03 PM
    If I do
    Observable.fromIterable(list).flatMap{ fetchItem(item) }
    does every item get fetched in parallel?
    a
    a
    • 3
    • 2
  • u

    ursus

    06/30/2018, 12:19 AM
    -- Also, is there a way to just reset a value of BehaviourRelay without emitting?
    e
    • 2
    • 1
  • d

    darkmoon_uk

    07/11/2018, 11:10 AM
    I say this in full understanding why Subjects are 'non-Rx' in many use cases... but as model fields... it actually seems really useful for achieving 'reactiveness' between otherwise loosely connected parts of an App. I just wondered if anyone had positive experience following this pattern, or it has been avoided either a) because it has identifiable downfalls or b) just because a 'subjects are bad' dogma (in which case that might bear challenging).
    c
    • 2
    • 6
  • b

    blakelee

    07/19/2018, 10:45 PM
    My weird case is when I do
    var myVariable: Int = 0
        private set(value) {
          field = value
          BehaviorSubject.onNext(BehaviorSubject.value)
       }
    z
    p
    • 3
    • 3
  • t

    toby

    07/23/2018, 12:37 PM
    Any help will be greatly appreciated
    l
    a
    • 3
    • 8
  • l

    liminal

    07/23/2018, 12:39 PM
    @edwardwongtl but then userManager.getUser() will execute even if tokensManager emits error
    e
    • 2
    • 1
  • a

    arekolek

    07/27/2018, 12:59 PM
    something like this?
    fun isReadyToGo(
        loginAnonymously: Single<TokenData>,
        saveTokenData: (TokenData) -> Completable,
        isLoggedIn: Single<Boolean>
    ): Completable {
        return isLoggedIn
            .filter { !it }
            .flatMapSingleElement { loginAnonymously }
            .flatMapCompletable(saveTokenData)
    }
    not sure if it's not harder to understand though 😛
    u
    l
    • 3
    • 5
  • u

    ursus

    07/28/2018, 12:02 AM
    var obs = map { success(it) }
            if (idle != null) {
                obs = obs.endWith(idle())
            }
            return obs.doOnError(LOG::e)
                    .onErrorReturn { t -> error(defaultErrorTransformer.throwableToType(t, customErrorTransformation)) }
                    .observeOn(AndroidSchedulers.mainThread())
                    .startWith(started())
    👍 2
    e
    • 2
    • 3
  • u

    ubu

    07/29/2018, 9:50 PM
    Good evening everyone, is there a nice way to fetch paginated data from backend using retrofit and rxjava adapter? Recursion? Thanks.
    m
    h
    • 3
    • 2
  • u

    ursus

    07/29/2018, 10:35 PM
    like what, multiple pages at once or via ui?
    u
    • 2
    • 1
  • u

    ubu

    08/10/2018, 10:16 AM
    @edwardwongtl, thanks. could you post the link to the docs?
    g
    • 2
    • 2
  • u

    ursus

    08/24/2018, 3:10 PM
    @Paul Woitaschek who then subscribes?
    u
    • 2
    • 8
  • a

    alexsullivan114

    08/29/2018, 8:00 PM
    Question for y'all: Is there an operator similar to
    combineLatest
    but that emits as soon as any of the combined streams have a value? Right now it appears that
    combineLatest
    will only emit once all of the streams have a value, and will then emit each time one of the streams is updated.
    b
    u
    • 3
    • 17
  • u

    ubu

    08/30/2018, 2:57 PM
    @kioba, would it retry to getPlacePrediction for B?
    k
    • 2
    • 1
  • u

    ursus

    09/01/2018, 2:56 AM
    -- is calling functions
    fooObservable()
    a hungarian notation?
    k
    • 2
    • 1
Powered by Linen
Title
u

ursus

09/01/2018, 2:56 AM
-- is calling functions
fooObservable()
a hungarian notation?
k

kioba

09/02/2018, 8:50 AM
not exactly, but the function user will see the return type so its really not necessary to mention it inside the function name.
View count: 5