T
- the success value typepublic interface SingleEmitter<T>
SingleSubscriber
that gets either an onSuccess or onError
signal and allows registering an cancellation/unsubscription callback.
All methods are thread-safe; calling onSuccess or onError twice or one after the other has no effect.
History: 1.2.3 - experimental
Modifier and Type | Method and Description |
---|---|
void |
onError(java.lang.Throwable t)
Notifies the SingleSubscriber that the
Single has experienced an error condition. |
void |
onSuccess(T t)
Notifies the SingleSubscriber that the
Single has completed successfully with
the given value. |
void |
setCancellation(Cancellable c)
Sets a Cancellable on this emitter; any previous Subscription
or Cancellation will be unsubscribed/cancelled.
|
void |
setSubscription(Subscription s)
Sets a Subscription on this emitter; any previous Subscription
or Cancellation will be unsubscribed/cancelled.
|
void onSuccess(T t)
Single
has completed successfully with
the given value.
If the Single
calls this method, it will not thereafter call
onError(java.lang.Throwable)
.
t
- the success valuevoid onError(java.lang.Throwable t)
Single
has experienced an error condition.
If the Single
calls this method, it will not thereafter call
onSuccess(T)
.
t
- the exception encountered by the Observablevoid setSubscription(Subscription s)
s
- the subscription, null is allowedvoid setCancellation(Cancellable c)
c
- the cancellable resource, null is allowed