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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Supplier<AsyncDelay>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    after(Throwable cause, Runnable task)
    Runs the task after delay on an implementation-defined thread.
    void
    after(Throwable cause, Runnable task, Executor executor)
    Runs the task after delay on given Executor.
  • Field Details

  • Method Details

    • after

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

      Equivalent to after(task, null).

    • after

      void after(Throwable cause, 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.