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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Sends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellable
is not interested in the outcome of the execution.final void
delayedCancellable
(Cancellable delayedCancellable) Set the delayedCancellable
.protected final void
Ignores 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:Cancellable
Sends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellable
is not interested in the outcome of the execution.- Specified by:
cancel
in 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 providedCancellable
will be immediately cancelled to prevent leakage of resources.
-