Interface AsyncDelay

  • All Known Implementing Classes:
    TimerDelay

    public interface AsyncDelay
    Performs a delay asynchronously. That is, schedules a task to be executed after the delay, potentially on another thread. If no delay is needed, the task may be executed directly on the calling thread.
    • Method Detail

      • after

        default void after​(Runnable task)
        Runs the task after delay on an implementation-defined thread.

        Equivalent to after(task, null).

      • after

        void after​(Runnable task,
                   Executor executor)
        Runs the task after delay on given Executor. If given executor is null, the task is executed on an implementation-defined thread.