Interface TimerTask


public interface TimerTask
A task which is executed after the delay specified with Timer.newTimeout(TimerTask, long, TimeUnit).
  • Method Details

    • run

      void run(Timeout timeout) throws java.lang.Exception
      Executed after the delay specified with Timer.newTimeout(TimerTask, long, TimeUnit).
      Parameters:
      timeout - a handle which is associated with this task
      Throws:
      java.lang.Exception
    • cancelled

      default void cancelled(Timeout timeout)
      Called for TimerTasks that are successfully canceled via Timeout.cancel(). Overriding this method allows to for example run some cleanup.
      Parameters:
      timeout - a handle which is associated with this task