Package groovy.concurrent
Interface Cancellable
public interface Cancellable
A handle for a scheduled action that can be called off before it
fires (or that can have its further firings suppressed, in the case
of a recurring schedule).
Returned by ActorContext.scheduleOnce(Object, java.time.Duration)
and ActorContext.scheduleAtFixedRate(Object, java.time.Duration, java.time.Duration).
- Since:
- 6.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleancancel()Attempts to cancel the scheduled action.booleanReturnstrueif this scheduled action has been cancelled.
-
Method Details
-
cancel
boolean cancel()Attempts to cancel the scheduled action. Returnstrueif cancellation prevented at least one further firing,falseif the action had already fired (one-shot), had already been cancelled, or could not be cancelled.Idempotent: calling
cancel()repeatedly is safe. -
isCancelled
boolean isCancelled()Returnstrueif this scheduled action has been cancelled.
-