It is sometimes called “functional reactive programming” but this is a misnomer. ReactiveX may be functional, and it may be reactive, but “functional reactive programming” is a different animal. One main point of difference is that functional reactive programming operates on values that change continuously over time, while ReactiveX operates on discrete values that are emitted over time. (See Conal Elliott’s work for more-precise information on functional reactive programming.)
所以才有了下面的 F&RP(Functional And Reactive Programming) != FRP.
关于Nekocode提到的subscribeOn和observeOn。 多个subscribeOn是有效果的,只不过不针对所有操作符都会有“可见”的效果。详细可以参考RxJava2 主要作者的最新博文 When multiple subscribeOn()s do have effect
而且这个问题衍生出还有一个问题就是某些操作符是自带默认Scheduler的(大部分都是computation),比如interval,timer,delay等等。这些操作符也会使得 subscribeOn "失效"
当然他们这么说是为了和Conal Elliott这个“Functional Reactive Programming的发明者” 避嫌。
比如一个反面例子: Why I cannot say FRP but I just did
所以才有了下面的 F&RP(Functional And Reactive Programming) != FRP.
关于Nekocode提到的
subscribeOn
和observeOn
。 多个subscribeOn
是有效果的,只不过不针对所有操作符都会有“可见”的效果。详细可以参考RxJava2 主要作者的最新博文 When multiple subscribeOn()s do have effect 而且这个问题衍生出还有一个问题就是某些操作符是自带默认Scheduler的(大部分都是computation),比如interval
,timer
,delay
等等。这些操作符也会使得subscribeOn
"失效"关于create生成的异步操作。并不会直接Interrupt你的Thread.这个是 subscribeOn关闭了subscribeOn生成的线程。具体会不会对线程操作会和对应的Scheduler相关。Observable.create是线程无关的。比如你如果使用
AndroidSchedulers.MainThread()
就不会出现interrupt的情况。总体还是特别好的活动,非常支持:+1: