Class TerminalNotification
- java.lang.Object
-
- io.servicetalk.concurrent.internal.TerminalNotification
-
public final class TerminalNotification extends java.lang.Object
Holder ofThrowable
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
cause()
Returns the cause of error if this is an error notification.static TerminalNotification
complete()
Returns aTerminalNotification
for completion.static TerminalNotification
error(java.lang.Throwable cause)
Returns aTerminalNotification
forcause
.void
terminate(CompletableSource.Subscriber subscriber)
InvokeCompletableSource.Subscriber.onComplete()
orCompletableSource.Subscriber.onError(Throwable)
on the passedsubscriber
.void
terminate(CompletableSource.Subscriber subscriber, java.lang.Throwable additionalCause)
InvokeCompletableSource.Subscriber.onError(Throwable)
with the passedThrowable
if thisTerminalNotification
is for completion.void
terminate(PublisherSource.Subscriber<?> subscriber)
InvokePublisherSource.Subscriber.onComplete()
orPublisherSource.Subscriber.onError(Throwable)
on the passedsubscriber
.void
terminate(PublisherSource.Subscriber<?> subscriber, java.lang.Throwable additionalCause)
InvokePublisherSource.Subscriber.onError(Throwable)
with the passedThrowable
if thisTerminalNotification
is for completion.java.lang.String
toString()
-
-
-
Method Detail
-
terminate
public void terminate(PublisherSource.Subscriber<?> subscriber)
InvokePublisherSource.Subscriber.onComplete()
orPublisherSource.Subscriber.onError(Throwable)
on the passedsubscriber
.- Parameters:
subscriber
- to terminate.
-
terminate
public void terminate(PublisherSource.Subscriber<?> subscriber, java.lang.Throwable additionalCause)
InvokePublisherSource.Subscriber.onError(Throwable)
with the passedThrowable
if thisTerminalNotification
is for completion.If this
TerminalNotification
is for error, then the passedThrowable
will be added as a suppressed cause to the existingThrowable
. If this is an error notification, the associated cause will get updated with theadditionalCause
.- Parameters:
subscriber
- to terminate.additionalCause
-Throwable
which is used as the caus
-
terminate
public void terminate(CompletableSource.Subscriber subscriber, java.lang.Throwable additionalCause)
InvokeCompletableSource.Subscriber.onError(Throwable)
with the passedThrowable
if thisTerminalNotification
is for completion.If this
TerminalNotification
is for error, then the passedThrowable
will be added as a suppressed cause to the existingThrowable
. If this is an error notification, the associated cause will get updated with theadditionalCause
.- Parameters:
subscriber
- to terminate.additionalCause
-Throwable
which is used as the caus
-
terminate
public void terminate(CompletableSource.Subscriber subscriber)
InvokeCompletableSource.Subscriber.onComplete()
orCompletableSource.Subscriber.onError(Throwable)
on the passedsubscriber
.- Parameters:
subscriber
- to terminate.
-
cause
@Nullable public java.lang.Throwable cause()
Returns the cause of error if this is an error notification.- Returns:
Throwable
if this is an error notification, otherwisenull
.
-
error
public static TerminalNotification error(java.lang.Throwable cause)
Returns aTerminalNotification
forcause
.- Parameters:
cause
- for the notification.- Returns:
TerminalNotification
forcause
.
-
complete
public static TerminalNotification complete()
Returns aTerminalNotification
for completion.- Returns:
TerminalNotification
for completion.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-