Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一些演讲里不太明确的地方 #3

Open
wbinarytree opened this issue Dec 1, 2017 · 2 comments
Open

一些演讲里不太明确的地方 #3

wbinarytree opened this issue Dec 1, 2017 · 2 comments

Comments

@wbinarytree
Copy link

  1. 扔物线在演讲中说道:
    关于RxJava和FRP的关系。在最初Netflix开发和宣传RxJava的时候,就以这个名字为宣传点,比如:GOTO 2013 • Functional Reactive Programming with RxJava • Ben Christensen 不过他也确实在talk里说道“我觉得这个名字好像不太好,但是我找不到更好的名字”。
    而且FRP这个名字,究竟怎么回事,大家也都各执一词。
    ReactiveX自己的说法:

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.)

当然他们这么说是为了和Conal Elliott这个“Functional Reactive Programming的发明者” 避嫌。

比如一个反面例子: Why I cannot say FRP but I just did

所以才有了下面的 F&RP(Functional And Reactive Programming) != FRP.

  1. 关于Nekocode提到的subscribeOnobserveOn。 多个subscribeOn是有效果的,只不过不针对所有操作符都会有“可见”的效果。详细可以参考RxJava2 主要作者的最新博文 When multiple subscribeOn()s do have effect
    而且这个问题衍生出还有一个问题就是某些操作符是自带默认Scheduler的(大部分都是computation),比如interval,timer,delay等等。这些操作符也会使得 subscribeOn "失效"

  2. 关于create生成的异步操作。并不会直接Interrupt你的Thread.这个是 subscribeOn关闭了subscribeOn生成的线程。具体会不会对线程操作会和对应的Scheduler相关。Observable.create是线程无关的。比如你如果使用 AndroidSchedulers.MainThread() 就不会出现interrupt的情况。

总体还是特别好的活动,非常支持:+1:

@gejiaheng
Copy link
Contributor

感谢你指出的问题以及鼓励。
@rengwuxian @nekocode

@nekocode
Copy link
Contributor

nekocode commented Dec 5, 2017

不 At 我我还真没看到。针对第三点,我刚查阅了下 Scheduler 的源码,确实 dispose() 的实际行为是由 Scheduler/Worker 控制的,也不一定会 Interrupt Thread,很感谢指出并做出补充。

欢迎以后有更深入的探讨~哈哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants