T
- Type of the result of the SingleSource
.public static interface SingleSource.Subscriber<T>
SingleSource
.
The semantics and threading model of this interface is meant to be the same as
PublisherSource.Subscriber
, but simplified for the use case where the operations completes with a single
data element or fails.
Modifier and Type | Method and Description |
---|---|
void |
onError(java.lang.Throwable t)
Failed terminal state.
|
void |
onSubscribe(Cancellable cancellable)
Called when the associated
SingleSource is subscribed via SingleSource.subscribe(Subscriber) . |
void |
onSuccess(T result)
Success terminal state.
|
void onSubscribe(Cancellable cancellable)
SingleSource
is subscribed via SingleSource.subscribe(Subscriber)
.cancellable
- A Cancellable
that can be used to cancel the asynchronous computation for
this subscriber.void onSuccess(@Nullable T result)
No further events will be sent.
result
- of the SingleSource
.void onError(java.lang.Throwable t)
No further events will be sent.
t
- the throwable signaled.