Package io.servicetalk.concurrent
Interface SingleSource.Subscriber<T>
-
- Type Parameters:
T- Type of the result of theSingleSource.
- All Known Subinterfaces:
SingleSource.Processor<T,R>
- All Known Implementing Classes:
LegacyTestSingle,LoggingSingleSubscriber,TestSingleSubscriber
- Enclosing interface:
- SingleSource<T>
public static interface SingleSource.Subscriber<T>Subscriber of the outcome of aSingleSource.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonError(java.lang.Throwable t)Failed terminal state.voidonSubscribe(Cancellable cancellable)Called when the associatedSingleSourceis subscribed viaSingleSource.subscribe(Subscriber).voidonSuccess(T result)Success terminal state.
-
-
-
Method Detail
-
onSubscribe
void onSubscribe(Cancellable cancellable)
Called when the associatedSingleSourceis subscribed viaSingleSource.subscribe(Subscriber).- Parameters:
cancellable- ACancellablethat can be used to cancel the asynchronous computation for this subscriber.
-
onSuccess
void onSuccess(@Nullable T result)Success terminal state.No further events will be sent.
- Parameters:
result- of theSingleSource.
-
onError
void onError(java.lang.Throwable t)
Failed terminal state.No further events will be sent.
- Parameters:
t- the throwable signaled.
-
-