Package io.servicetalk.concurrent.api
Interface TerminalSignalConsumer
-
public interface TerminalSignalConsumerA contract that provides discrete callbacks for various ways in which aPublisherSource.Subscriberor aCompletableSource.Subscribercan terminate.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel()Callback to indicate termination viaCancellable.cancel().static TerminalSignalConsumerfrom(java.lang.Runnable runnable)Create aTerminalSignalConsumerwhere each method executes aRunnable.run().voidonComplete()Callback to indicate termination viaPublisherSource.Subscriber.onComplete()orCompletableSource.Subscriber.onComplete().voidonError(java.lang.Throwable throwable)Callback to indicate termination viaPublisherSource.Subscriber.onError(Throwable)orCompletableSource.Subscriber.onError(Throwable).
-
-
-
Method Detail
-
onComplete
void onComplete()
Callback to indicate termination viaPublisherSource.Subscriber.onComplete()orCompletableSource.Subscriber.onComplete().
-
onError
void onError(java.lang.Throwable throwable)
Callback to indicate termination viaPublisherSource.Subscriber.onError(Throwable)orCompletableSource.Subscriber.onError(Throwable).- Parameters:
throwable- the observedThrowable.
-
cancel
void cancel()
Callback to indicate termination viaCancellable.cancel().
-
from
static TerminalSignalConsumer from(java.lang.Runnable runnable)
Create aTerminalSignalConsumerwhere each method executes aRunnable.run().- Parameters:
runnable- TheRunnablewhich is invoked in each method of the returnedTerminalSignalConsumer.- Returns:
- a
TerminalSignalConsumerwhere each method executes aRunnable.run().
-
-