io.vertx.core

## Interface Timer

- All Superinterfaces:
    AsyncResult<Void>, Future<Void>

      public interface Timer
      extends 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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel()` Attempt to cancel the timer task, when the timer is cancelled, the timer is failed with a `CancellationException`.

    - ### Methods inherited from interface io.vertx.core.Future

      `all, all, all, all, all, all, andThen, any, any, any, any, any, any, await, await, cause, compose, compose, eventually, eventually, expecting, failed, failedFuture, failedFuture, flatMap, fromCompletionStage, fromCompletionStage, future, isComplete, join, join, join, join, join, join, map, map, mapEmpty, onComplete, onComplete, onFailure, onSuccess, otherwise, otherwise, otherwiseEmpty, recover, result, succeeded, succeededFuture, succeededFuture, timeout, toCompletionStage, transform`

- - ### Method Detail

    - #### cancel

          boolean cancel()

      Attempt to cancel the timer task, when the timer is cancelled, the timer is failed with a `CancellationException`.
      Returns:
        `true` when the future was cancelled and the timeout didn't fire.

Copyright © 2025 Eclipse. All rights reserved.