T- the type of item the SingleSubscriber expects to observe
public abstract class SingleSubscriber<T> extends java.lang.Object implements Subscription
After a SingleSubscriber calls a
subscribe method, the
Single calls the SingleSubscriber's
onError(java.lang.Throwable) methods to provide
notifications. A well-behaved
Single will call a SingleSubscriber's
onSuccess(T) method exactly
once or the SingleSubscriber's
onError(java.lang.Throwable) method exactly once.
|Constructor and Description|
|Modifier and Type||Method and Description|
Indicates whether this Subscriber has unsubscribed from its list of subscriptions.
Notifies the SingleSubscriber that the
Notifies the SingleSubscriber with a single item and that the
Stops the receipt of notifications on the
public abstract void onSuccess(T t)
Singlehas finished sending push-based notifications.
t- the item emitted by the Single
public abstract void onError(java.lang.Throwable error)
Singlehas experienced an error condition.
error- the exception encountered by the Single
public final void add(Subscription s)
Subscriptionto this Subscriber's list of subscriptions if this list is not marked as unsubscribed. If the list is marked as unsubscribed,
addwill indicate this by explicitly unsubscribing the new
public final void unsubscribe()
Subscriberthat was registered when this Subscription was received.
This allows deregistering an
Subscriber before it has finished receiving all events (i.e. before
onCompleted is called).