Observer Metodo:onNext, onCompleted, and onError
来源:互联网 发布:黑岩阅读软件 编辑:程序博客网 时间:2024/05/16 06:05
原文链接:http://reactivex.io/documentation/observable.html
onNext, onCompleted, and onError
The Subscribe method is how you connect an observer to an Observable. Your observer implements some subset of the following methods:
onNext
An Observable calls this method whenever the Observable emits an item. This method takes as a parameter the item emitted by the Observable.
onError
An Observable calls this method to indicate that it has failed to generate the expected data or has encountered some other error. It will not make further calls to onNext or onCompleted. The onError method takes as its parameter an indication of what caused the error.
onCompleted
An Observable calls this method after it has called onNext for the final time, if it has not encountered any errors.
Unsubscribing
In some ReactiveX implementations, there is a specialized observer interface, Subscriber, that implements an unsubscribe method. You can call this method to indicate that the Subscriber is no longer interested in any of the Observables it is currently subscribed to. Those Observables can then (if they have no other interested observers) choose to stop generating new items to emit.
The results of this unsubscription will cascade back through the chain of operators that applies to the Observable that the observer subscribed to, and this will cause each link in the chain to stop emitting items. This is not guaranteed to happen immediately, however, and it is possible for an Observable to generate and attempt to emit items for a while even after no observers remain to observe these emissions.
- Observer Metodo:onNext, onCompleted, and onError
- rxjava onError,onNext,onCompleted 怎么理解;
- RxJava中的onNext onCompleted onError onStart() 在什么线程中被调用
- Rxjava1.x中在onNext()中抛出了异常,会执行onError()方法
- Rxjava2中Concat操作符onNext,OnError,OnComplte的执行顺序
- Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value
- catch(ex) and window.onerror
- RxJava occurred when trying to propagate error to Observer.onError
- onerror
- onerror
- onerror
- Android Observable and Observer
- Android Observable and Observer
- rxjava onCompleted 方法的理解
- Understanding and Implementing Observer Pattern in C++
- android Observable and Observer(观察者模式)
- android Observable and Observer(观察者模式)
- Observer
- 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?
- Java笔试选择题要点总结
- 视差特效实现思路
- 作业
- caffe学习(七):使用py-faster-rcnn来训练voc2007数据集(Ubuntu)
- Observer Metodo:onNext, onCompleted, and onError
- mark
- HDU-2873 Bomb Game
- mapreduce中分割字符串
- sql函数计算,数据库字段的长度函数
- 数据结构实验之查找二:平衡二叉树
- until、while、case、select等语句的使用方法
- Swing实现简单的简历样式
- JavaScript的cookie存储