Class TaskScheduler

java.lang.Object
io.activej.reactor.AbstractReactive
io.activej.async.service.TaskScheduler
All Implemented Interfaces:
ReactiveService, ReactiveJmxBean, ReactiveJmxBeanWithStats, Reactive

public final class TaskScheduler extends AbstractReactive implements ReactiveService, ReactiveJmxBeanWithStats
  • Method Details

    • resetStats

      public void resetStats()
      Specified by:
      resetStats in interface ReactiveJmxBeanWithStats
    • builder

      public static <T> TaskScheduler.Builder builder(Reactor reactor, AsyncSupplier<T> task)
    • start

      public Promise<?> start()
      Description copied from interface: ReactiveService
      Starts this component asynchronously. Callback completes immediately if the component is already running.
      Specified by:
      start in interface ReactiveService
    • stop

      public Promise<?> stop()
      Description copied from interface: ReactiveService
      Stops this component asynchronously. Callback completes immediately if the component is not running / already stopped.
      Specified by:
      stop in interface ReactiveService
    • setSchedule

      public void setSchedule(TaskScheduler.Schedule schedule)
    • setRetryPolicy

      public void setRetryPolicy(RetryPolicy<?> retryPolicy)
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • getStats

      public PromiseStats getStats()
    • getLastException

      @Nullable public @Nullable Exception getLastException()
    • getInitialDelay

      public long getInitialDelay()
    • getPeriod

      @Nullable public @Nullable Duration getPeriod()
    • setPeriod

      public void setPeriod(Duration period)
    • getInterval

      @Nullable public @Nullable Duration getInterval()
    • setInterval

      public void setInterval(Duration interval)
    • startNow

      public void startNow()