-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
LifecycleScope 移除 Observer 的疑问 #25
Comments
看起来确实是多余的,应该是手误,容我再回忆回忆 |
还有一个点想跟老哥讨论一下,我看RxHttp和RxLife封装的Observer都对onNext做了try catch,我onNext里处理逻辑抛出异常,同样会走onError处理逻辑,这样的话相当于onNext和onError都触发了,两者并不是互斥的,就是这么设计的吗? |
是的,RxJava就是这么设计的 |
我刚有看Rxjava的设计,当传入onNext consumer和onError consumer 异常是会被捕获因为封装了一层observer,前提未进行线程切换,但如果使用自定义Observe异常是捕获不住的。 |
前提未进行线程切换?这句话我没看懂 |
线程切换这点理解有误,主要还是看Observer的处理机制 |
是的, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LifecycleScope 为什么要在 onScopeStart 方法中执行 onScopeEnd 去主动移除 observer 监听,然后重新添加?
The text was updated successfully, but these errors were encountered: