Class CommandScheduler

  • All Implemented Interfaces:
    net.jodah.failsafe.util.concurrent.Scheduler

    public class CommandScheduler
    extends Object
    implements net.jodah.failsafe.util.concurrent.Scheduler
    Class CommandScheduler.
    • Method Detail

      • create

        public static CommandScheduler create​(int threadPoolSize)
        If no command scheduler exists, creates one using default values. Disables daemon threads.
        Parameters:
        threadPoolSize - Size of thread pool for async commands.
        Returns:
        Existing scheduler or newly created one.
      • schedule

        public ScheduledFuture<?> schedule​(Callable<?> callable,
                                           long delay,
                                           TimeUnit unit)
        Schedules a task using an executor.
        Specified by:
        schedule in interface net.jodah.failsafe.util.concurrent.Scheduler
        Parameters:
        callable - The callable.
        delay - Delay before scheduling task.
        unit - Unite of delay.
        Returns:
        Future to track task execution.