T - the type of items expected to be emitted to the Subscriberpublic class SerializedSubscriber<T> extends Subscriber<T>
onNext(T), onCompleted(), and
onError(java.lang.Throwable).
When multiple threads are emitting and/or notifying they will be serialized by:
| Constructor and Description |
|---|
SerializedSubscriber(Subscriber<? super T> s) |
SerializedSubscriber(Subscriber<? super T> 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<? super T> s)
public SerializedSubscriber(Subscriber<? super T> s, boolean shareSubscriptions)
s - the subscriber to wrap and serializeshareSubscriptions - if true, the same subscription list is shared between this subscriber and s.public void onCompleted()
Observable has finished sending push-based notifications.
The Observable will not call this method if it calls onError(java.lang.Throwable).
public void onError(java.lang.Throwable e)
Observable has experienced an error condition.
If the Observable calls this method, it will not thereafter call onNext(T) or
onCompleted().
e - the exception encountered by the Observablepublic void onNext(T t)
The Observable may call this method 0 or more times.
The Observable will not call this method again after it calls either onCompleted() or
onError(java.lang.Throwable).
t - the item emitted by the Observable