Package org.apache.ignite.lang
Class CancelHandleHelper
java.lang.Object
org.apache.ignite.lang.CancelHandleHelper
Utility class to provide direct access to internals of
CancelHandleImpl.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCancelAction(org.apache.ignite.lang.CancellationToken token, Runnable cancelAction, CompletableFuture<?> completionFut) Attaches a cancellable operation to the given token.static voidaddCancelAction(org.apache.ignite.lang.CancellationToken token, CompletableFuture<?> completionFut) Attaches a future to the given token.
-
Method Details
-
addCancelAction
public static void addCancelAction(org.apache.ignite.lang.CancellationToken token, Runnable cancelAction, CompletableFuture<?> completionFut) Attaches a cancellable operation to the given token. A cancellation procedure started its handle completes whencompletionFutcompletes.NOTE: If a handle, this token is associated with, was cancelled or its cancellation was requested, this method immediately invokes
cancelAction.run()and it this case it never waits forcompletionFutto complete.The following methods request cancellation of a handle:
CancelHandle.cancel()CancelHandle.cancelAsync()
- Parameters:
token- Cancellation token.cancelAction- Action that terminates an operation.completionFut- Future that completes when operation completes and all resources it created are released.
-
addCancelAction
public static void addCancelAction(org.apache.ignite.lang.CancellationToken token, CompletableFuture<?> completionFut) Attaches a future to the given token. A cancellation procedure callCompletableFuture.cancel(boolean)and handle completes whencompletionFutcompletes.- Parameters:
token- Cancellation token.completionFut- Future that completes when operation completes and all resources it created are released.
-