Interface Timer
- All Superinterfaces:
AsyncResult<Void>, Comparable<Delayed>, Delayed, Future<Void>
A timer task that can be used as a future.
The future is completed when the timeout expires, when the task is cancelled the future is failed
with a
CancellationException.- Author:
- Julien Viet
-
Method Summary
Methods inherited from interface Future
andThen, andThen, await, await, cause, compose, compose, eventually, expecting, failed, flatMap, isComplete, map, map, mapEmpty, onComplete, onComplete, onComplete, onFailure, onSuccess, otherwise, otherwise, otherwiseEmpty, recover, result, succeeded, timeout, toCompletionStage, transform, transform
-
Method Details
-
cancel
boolean cancel()Attempt to cancel the timer task, when the timer is cancelled, the timer is failed with aCancellationException.- Returns:
truewhen the future was cancelled and the timeout didn't fire.
-
getDelay
-
compareTo
- Specified by:
compareToin interfaceComparable<Delayed>
-