https://kotlinlang.org logo
#android
Title
# android
a

alec

07/05/2019, 2:09 PM
use the
execute
methods instead of
asObservable
b

Ben Tseytlin

07/05/2019, 2:10 PM
Won’t that execute on the main thread? I was taking advantage of Rxjava thread handling so it could perform on IO and i could post results back to main thread
a

alec

07/05/2019, 2:11 PM
then what jake said
j

jw

07/05/2019, 2:11 PM
or
Single.fromCallable(query::execute)
b

Ben Tseytlin

07/05/2019, 2:12 PM
Will give it a try. But about point (1), how should one remove the listener if they do want it? I see this causing a leak if the listener stays around
a

alec

07/05/2019, 2:13 PM
when the disposable is disposed it will unregister the listener
j

jw

07/05/2019, 2:13 PM
take(1)
will unsubscribe after the first emission which will cause the listener to be removed
b

Ben Tseytlin

07/05/2019, 2:14 PM
Super excited about SQLDelight, we’re working it into the project now and so far it’s awesome. Thanks so much for the help and the sweet library
will do!
3 Views