Package io.servicetalk.concurrent.api
Interface SingleTerminalSignalConsumer<T>
- Type Parameters:
T
- Type of the result of theSingle
.
public interface SingleTerminalSignalConsumer<T>
A contract that provides discrete callbacks for various ways in which a
SingleSource.Subscriber
can
terminate.-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Callback to indicate termination viaCancellable.cancel()
.static <X> SingleTerminalSignalConsumer<X>
Create aSingleTerminalSignalConsumer
where each method executes aRunnable.run()
.void
Callback to indicate termination viaSingleSource.Subscriber.onError(Throwable)
.void
Callback to indicate termination viaSingleSource.Subscriber.onSuccess(Object)
.
-
Method Details
-
onSuccess
Callback to indicate termination viaSingleSource.Subscriber.onSuccess(Object)
.- Parameters:
result
- the observed result of typeSingleTerminalSignalConsumer
.
-
onError
Callback to indicate termination viaSingleSource.Subscriber.onError(Throwable)
.- Parameters:
throwable
- the observedThrowable
.
-
cancel
void cancel()Callback to indicate termination viaCancellable.cancel()
. -
from
Create aSingleTerminalSignalConsumer
where each method executes aRunnable.run()
.- Type Parameters:
X
- The type ofSingleTerminalSignalConsumer
.- Parameters:
runnable
- TheRunnable
which is invoked in each method of the returnedSingleTerminalSignalConsumer
.- Returns:
- a
SingleTerminalSignalConsumer
where each method executes aRunnable.run()
.
-