Android Pros & Cons: Event Bus and RxJava

馋奶兔 提交于 2019-11-30 03:39:01

1) Once you have an instance of an Observable, you can subscribe to it at any time and from any thread, even concurrently.

2) We usually merge the streams of multiple observables via Observable.merge() or use a serialized PublishSubject.

3) If you observe an Observable, there could be dozens of upstream operators and sources involved, but you'll get a sequential stream of values no matter what. You only need to get a hold onto an Observable representing some source of events and the observer doesn't need to know if the event was merged, filtered, made a roundtrip over the network and got delayed before arriving in your onNext() method. You can naturally implement or use some lookup service that will get you an Observable to reduce the coupling, but with RxJava, coupling is not usually an issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!