Class DelayedCancellable

java.lang.Object
io.servicetalk.concurrent.internal.DelayedCancellable
All Implemented Interfaces:
Cancellable

public class DelayedCancellable extends Object implements Cancellable
A Cancellable which serves as a placeholder until the "real" Cancellable is available.
  • Constructor Details

    • DelayedCancellable

      public DelayedCancellable()
  • Method Details

    • delayedCancellable

      public final void delayedCancellable(Cancellable delayedCancellable)
      Set the delayed Cancellable. This method can only be called a single time and subsequent calls will result in cancel() being call on delayedCancellable.
      Parameters:
      delayedCancellable - The delayed Cancellable.
    • 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 this Cancellable is not interested in the outcome of the execution.
      Specified by:
      cancel in interface Cancellable
    • ignoreCancel

      protected final void ignoreCancel()
      Ignores any subsequent calls to cancel(), preventing propagating the cancellation further up the stream.

      Note: if delayedCancellable(Cancellable) is called after this method, the provided Cancellable will be immediately cancelled to prevent leakage of resources.