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 aSingleSource.Subscriber
can terminate.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel()
Callback to indicate termination viaCancellable.cancel()
.static <X> SingleTerminalSignalConsumer<X>
from(java.lang.Runnable runnable)
Create aSingleTerminalSignalConsumer
where each method executes aRunnable.run()
.void
onError(java.lang.Throwable throwable)
Callback to indicate termination viaSingleSource.Subscriber.onError(Throwable)
.void
onSuccess(T result)
Callback to indicate termination viaSingleSource.Subscriber.onSuccess(Object)
.
-
-
-
Method Detail
-
onSuccess
void onSuccess(@Nullable T result)
Callback to indicate termination viaSingleSource.Subscriber.onSuccess(Object)
.- Parameters:
result
- the observed result of typeSingleTerminalSignalConsumer
.
-
onError
void onError(java.lang.Throwable throwable)
Callback to indicate termination viaSingleSource.Subscriber.onError(Throwable)
.- Parameters:
throwable
- the observedThrowable
.
-
cancel
void cancel()
Callback to indicate termination viaCancellable.cancel()
.
-
from
static <X> SingleTerminalSignalConsumer<X> from(java.lang.Runnable runnable)
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()
.
-
-