The SubscribeOn operator changes this behavior by specifying a different Scheduler on which the Observable should operate.
The ObserveOn operator specifies a different Scheduler that the Observable will use to send notifications to its observers.
The SubscribeOn operator designates which thread the Observable will begin operating on, no matter at what point in the chain of operators that operator is called.
ObserveOn, on the other hand, affects the thread that the Observable will use below where that operator appears.
ObserveOn影响其后操作使用的线程
SubscribeOn影响所有操作, 但ObserveOn优先
SubscribeOn在chain中的位置无所谓
多个SubscribeOn,第一个有效
测试代码:
参考http://reactivex.io/documentation/scheduler.html
http://www.grahamlea.com/2014/07/rxjava-threading-examples/
相关推荐
小RxJava 小RxJava
RXJava 2和RXJava 3之间的桥梁
This compact book includes in-depth introductions to RxJava, Akka Streams, and Reactor, and integrates the latest related features from Java 9 and 11, as well as reactive streams programming with the...
RxJava RxJava之扔物线给Android开发者的RxJava详解文章中的例子 Build To build: >$ git clone https://github.com/androidmalin/RengwuxianRxjava.git >$ cd RengwuxianRxjava/ >$ gradle clean --stacktrace(./...
subscribeOn和observeOn负责线程切换,同时某些操作符也默认指定了线程. 我们这里不分析在线程中怎么执行的.只看如何切换到某个指定线程. subscribeOn Observable.subscribeOn()在方法内部生成了一个...
Learn how to use RxJava and its reactive Observables to build fast, concurrent, and powerful applications through detailed examples About This Book Learn about Java 8's lambdas and what reactive ...
Learning Reactive Programming With Java 8 Example Runner This project contains the examples of the 'Learning Reactive Programming With Java ...Navigate to the root of the project (cd learning-rxjava) and
(基于kotlin语言,包含java版本)Baae MVP use Rxjava+Retrofit and some.zip
A library that manages state using RxJava 2 and Architecture Components. Medium Post: https://goo.gl/7oH1B1 Getting Started Project root build.gradle allprojects { repositories { maven { url '...
RXJava中文帮助文档,感谢翻译人员
Kotlin and RxJava on Android 最新代码github:https://github.com/cn-ljb/rxjava_for_kotlin
RxJava principles and provide a structured and simplified approach with a lot of code examples. This book seeks to serve as a foundation for experienced Android developers who are new to RxJava so ...
Reactive Streams in Java_ Concurrency with RxJava, Reactor, and Akka Streams英文版本,一边学英语,一般写RxJava
Rxjava
RxJava框架时序图-基本的RxJava例子, RxJava框架时序图-基本的RxJava例子
RXJava 2和RXJava 3之间的桥梁
Authors Tomasz Nurkiewicz and Ben Christensen include concrete examples that use the RxJava library to solve real-world performance issues on Android devices as well as the server. You’ll learn how ...
RxJava+Retrofit+MVP的简单Demo,有错误请留言指出
针对rxjava+retrofit的混淆文件 rxjava(1.1) retrofit(2.0)
android rxjava2 android rxjava2 android rxjava2