T - the type of items expected to be emitted to theSubscriberpublic classSerializedSubscriber<T>extendsSubscriber<T>
onNext(T),onCompleted(), andonError(java.lang.Throwable).When multiple threads are emitting and/or notifying they will be serialized by:
| Constructor and Description |
|---|
SerializedSubscriber(Subscriber<? superT> s) |
SerializedSubscriber(Subscriber<? superT> s, boolean shareSubscriptions)Constructor for wrapping and serializing a subscriber optionally sharing the same underlying subscription list. |
| Modifier and Type | Method and Description |
|---|---|
void | onCompleted()Notifies the Subscriber that the Observable has finished sending push-based notifications. |
void | onError(java.lang.Throwable e)Notifies the Subscriber that the Observable has experienced an error condition. |
void | onNext(T t)Provides the Subscriber with a new item to observe. |
add,isUnsubscribed,onStart,request,setProducer,unsubscribepublic SerializedSubscriber(Subscriber<? superT> s)
public SerializedSubscriber(Subscriber<? superT> s, boolean shareSubscriptions)
s - the subscriber to wrap and serializeshareSubscriptions - iftrue, the same subscription list is shared between this subscriber ands.public void onCompleted()
Observable has finished sending push-based notifications. TheObservable will not call this method if it callsonError(java.lang.Throwable).
public void onError(java.lang.Throwable e)
Observable has experienced an error condition. If theObservable calls this method, it will not thereafter callonNext(T) oronCompleted().
e - the exception encountered by the Observablepublic void onNext(T t)
TheObservable may call this method 0 or more times.
TheObservable will not call this method again after it calls eitheronCompleted() oronError(java.lang.Throwable).
t - the item emitted by the Observable