类 IntervalTask

java.lang.Object
cn.taketoday.scheduling.config.Task
cn.taketoday.scheduling.config.IntervalTask
直接已知子类:
FixedDelayTask, FixedRateTask

public class IntervalTask extends Task
Task implementation defining a Runnable to be executed at a given millisecond interval which may be treated as fixed-rate or fixed-delay depending on context.
从以下版本开始:
4.0
作者:
Chris Beams
另请参阅:
  • 构造器详细资料

    • IntervalTask

      public IntervalTask(Runnable runnable, long interval, long initialDelay)
      Create a new IntervalTask.
      参数:
      runnable - the underlying task to execute
      interval - how often in milliseconds the task should be executed
      initialDelay - the initial delay before first execution of the task
    • IntervalTask

      public IntervalTask(Runnable runnable, long interval)
      Create a new IntervalTask with no initial delay.
      参数:
      runnable - the underlying task to execute
      interval - how often in milliseconds the task should be executed
    • IntervalTask

      public IntervalTask(Runnable runnable, Duration interval)
      Create a new IntervalTask with no initial delay.
      参数:
      runnable - the underlying task to execute
      interval - how often the task should be executed
    • IntervalTask

      public IntervalTask(Runnable runnable, Duration interval, Duration initialDelay)
      Create a new IntervalTask.
      参数:
      runnable - the underlying task to execute
      interval - how often the task should be executed
      initialDelay - the initial delay before first execution of the task
  • 方法详细资料

    • getInterval

      public long getInterval()
      Return how often in milliseconds the task should be executed.
    • getIntervalDuration

      public Duration getIntervalDuration()
      Return how often the task should be executed.
    • getInitialDelay

      public long getInitialDelay()
      Return the initial delay before first execution of the task.
    • getInitialDelayDuration

      public Duration getInitialDelayDuration()
      Return the initial delay before first execution of the task.