Package io.servicetalk.concurrent
Interface Cancellable
-
- All Known Subinterfaces:
PublisherSource.Subscription
- All Known Implementing Classes:
ConcurrentSubscription,DeferredEmptySubscription,DelayedCancellable,DelayedSubscription,ScalarValueSubscription,SequentialCancellable,TestCancellable,TestSubscription,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 CancellableAn 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 CancellableIGNORE_CANCELAno-opinstance ofCancellable.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel()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.
-
-
-
Field Detail
-
IGNORE_CANCEL
static final Cancellable IGNORE_CANCEL
Ano-opinstance ofCancellable.
-
-