Package io.servicetalk.concurrent.api
Interface TerminalSignalConsumer
-
public interface TerminalSignalConsumer
A contract that provides discrete callbacks for various ways in which aPublisherSource.Subscriber
or aCompletableSource.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 TerminalSignalConsumer
from(java.lang.Runnable runnable)
Create aTerminalSignalConsumer
where each method executes aRunnable.run()
.void
onComplete()
Callback to indicate termination viaPublisherSource.Subscriber.onComplete()
orCompletableSource.Subscriber.onComplete()
.void
onError(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 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()
.
-
-