Class DelayedCancellable
java.lang.Object
io.servicetalk.concurrent.internal.DelayedCancellable
- All Implemented Interfaces:
Cancellable
A
Cancellable which serves as a placeholder until the "real" Cancellable is available.-
Field Summary
Fields inherited from interface io.servicetalk.concurrent.Cancellable
IGNORE_CANCEL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Sends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellableis not interested in the outcome of the execution.final voiddelayedCancellable(Cancellable delayedCancellable) Set the delayedCancellable.protected final voidIgnores any subsequent calls tocancel(), preventing propagating the cancellation further up the stream.
-
Constructor Details
-
DelayedCancellable
public DelayedCancellable()
-
-
Method Details
-
delayedCancellable
Set the delayedCancellable. This method can only be called a single time and subsequent calls will result incancel()being call ondelayedCancellable.- Parameters:
delayedCancellable- The delayedCancellable.
-
cancel
public void cancel()Description copied from interface:CancellableSends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellableis not interested in the outcome of the execution.- Specified by:
cancelin interfaceCancellable
-
ignoreCancel
protected final void ignoreCancel()Ignores any subsequent calls tocancel(), preventing propagating the cancellation further up the stream.Note: if
delayedCancellable(Cancellable)is called after this method, the providedCancellablewill be immediately cancelled to prevent leakage of resources.
-