Interface Cancellable

All Known Subinterfaces:
PublisherSource.Subscription
All Known Implementing Classes:
ConcurrentSubscription, DelayedCancellable, DelayedSubscription, ScalarValueSubscription, SequentialCancellable, ThreadInterruptingCancellable
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Cancellable
An entity that can be cancelled.

Cancellations are a hint from a consumer of any asynchronous result to the producer that it is no more interested in the result. ServiceTalk does not provide any guarantees that at a certain time, whether the asynchronous execution is cancellable or not. It is up to the producer of data to take any action on cancellation or ignore the same. Thus, a consumer of the result must not assume that it will not receive any callback post cancellation i.e. after cancel() returns.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Cancellable
    A no-op instance of Cancellable.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.
  • Field Details

  • Method Details

    • cancel

      void cancel()
      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.