Package io.servicetalk.concurrent
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.
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
-
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.
-
Field Details
-
IGNORE_CANCEL
Ano-op
instance ofCancellable
.
-
-
Method Details
-
cancel
void 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.
-