Class TerminalNotification
- java.lang.Object
-
- io.servicetalk.concurrent.internal.TerminalNotification
-
public final class TerminalNotification extends java.lang.ObjectHolder ofThrowable.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwablecause()Returns the cause of error if this is an error notification.static TerminalNotificationcomplete()Returns aTerminalNotificationfor completion.static TerminalNotificationerror(java.lang.Throwable cause)Returns aTerminalNotificationforcause.voidterminate(CompletableSource.Subscriber subscriber)InvokeCompletableSource.Subscriber.onComplete()orCompletableSource.Subscriber.onError(Throwable)on the passedsubscriber.voidterminate(CompletableSource.Subscriber subscriber, java.lang.Throwable additionalCause)InvokeCompletableSource.Subscriber.onError(Throwable)with the passedThrowableif thisTerminalNotificationis for completion.voidterminate(PublisherSource.Subscriber<?> subscriber)InvokePublisherSource.Subscriber.onComplete()orPublisherSource.Subscriber.onError(Throwable)on the passedsubscriber.voidterminate(PublisherSource.Subscriber<?> subscriber, java.lang.Throwable additionalCause)InvokePublisherSource.Subscriber.onError(Throwable)with the passedThrowableif thisTerminalNotificationis for completion.java.lang.StringtoString()
-
-
-
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 passedThrowableif thisTerminalNotificationis for completion.If this
TerminalNotificationis for error, then the passedThrowablewill 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-Throwablewhich is used as the caus
-
terminate
public void terminate(CompletableSource.Subscriber subscriber, java.lang.Throwable additionalCause)
InvokeCompletableSource.Subscriber.onError(Throwable)with the passedThrowableif thisTerminalNotificationis for completion.If this
TerminalNotificationis for error, then the passedThrowablewill 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-Throwablewhich 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:
Throwableif this is an error notification, otherwisenull.
-
error
public static TerminalNotification error(java.lang.Throwable cause)
Returns aTerminalNotificationforcause.- Parameters:
cause- for the notification.- Returns:
TerminalNotificationforcause.
-
complete
public static TerminalNotification complete()
Returns aTerminalNotificationfor completion.- Returns:
TerminalNotificationfor completion.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-