Package io.servicetalk.concurrent.api
Interface TerminalSignalConsumer
public interface TerminalSignalConsumer
A contract that provides discrete callbacks for various ways in which a
PublisherSource.Subscriber
or a
CompletableSource.Subscriber
can terminate.-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Callback to indicate termination viaCancellable.cancel()
.static TerminalSignalConsumer
Create aTerminalSignalConsumer
where each method executes aRunnable.run()
.void
Callback to indicate termination viaPublisherSource.Subscriber.onComplete()
orCompletableSource.Subscriber.onComplete()
.void
Callback to indicate termination viaPublisherSource.Subscriber.onError(Throwable)
orCompletableSource.Subscriber.onError(Throwable)
.
-
Method Details
-
onComplete
void onComplete()Callback to indicate termination viaPublisherSource.Subscriber.onComplete()
orCompletableSource.Subscriber.onComplete()
. -
onError
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
Create aTerminalSignalConsumer
where each method executes aRunnable.run()
.- Parameters:
runnable
- TheRunnable
which is invoked in each method of the returnedTerminalSignalConsumer
.- Returns:
- a
TerminalSignalConsumer
where each method executes aRunnable.run()
.
-