You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 "失效"
关于RxJava和FRP的关系。在最初Netflix开发和宣传RxJava的时候,就以这个名字为宣传点,比如:GOTO 2013 • Functional Reactive Programming with RxJava • Ben Christensen 不过他也确实在talk里说道“我觉得这个名字好像不太好,但是我找不到更好的名字”。
而且FRP这个名字,究竟怎么回事,大家也都各执一词。
ReactiveX自己的说法:
当然他们这么说是为了和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:
The text was updated successfully, but these errors were encountered: