T
- Type of the result of the Single
.public interface SingleTerminalSignalConsumer<T>
SingleSource.Subscriber
can
terminate.Modifier and Type | Method and Description |
---|---|
void |
cancel()
Callback to indicate termination via
Cancellable.cancel() . |
static <X> SingleTerminalSignalConsumer<X> |
from(java.lang.Runnable runnable)
Create a
SingleTerminalSignalConsumer where each method executes a Runnable.run() . |
void |
onError(java.lang.Throwable throwable)
Callback to indicate termination via
SingleSource.Subscriber#onError(Throwable) . |
void |
onSuccess(T result)
Callback to indicate termination via
SingleSource.Subscriber#onSuccess(Object) . |
void onSuccess(@Nullable T result)
SingleSource.Subscriber#onSuccess(Object)
.result
- the observed result of type T
.void onError(java.lang.Throwable throwable)
SingleSource.Subscriber#onError(Throwable)
.throwable
- the observed Throwable
.void cancel()
Cancellable.cancel()
.static <X> SingleTerminalSignalConsumer<X> from(java.lang.Runnable runnable)
SingleTerminalSignalConsumer
where each method executes a Runnable.run()
.X
- The type of SingleTerminalSignalConsumer
.runnable
- The Runnable
which is invoked in each method of the returned
SingleTerminalSignalConsumer
.SingleTerminalSignalConsumer
where each method executes a Runnable.run()
.