kaushikgopal / RxJava-Android-Samples

Learning RxJava for Android by example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rxbus in long running sticky service

sirvon opened this issue · comments

I'm super new to rx thinking, it took me like 4-5 mos to get this far in
implementing the future in my code so bare w/ me...

is it ok to use rxbus in a service?

I have network data incoming from a background service constantly, I want to send it on its way via rxbus to fragments, quite possibly even store the data based on certain conditions, along its route.

are there any issues thats a apparent with that use case?

i'm attempting all this now.

You can use it in a service, as long as you make sure that your service and the activity use the same instance of RxBus. Notice that you have to use a SerializedSubject in the RxBus if you're moving across different threads

P.s: I appreciate your questions but it would be better if you post your question on stack overflow, and point me to a url via twitter (unless it's an actual or issue with the code in the repo). opening up issues in github is probably not the best mechanism for queries.