Interface RScheduledExecutorService

All Superinterfaces:
Executor, ExecutorService, RExecutorService, RExecutorServiceAsync, RScheduledExecutorServiceAsync, ScheduledExecutorService
All Known Implementing Classes:
RedissonExecutorService

public interface RScheduledExecutorService extends RExecutorService, ScheduledExecutorService, RScheduledExecutorServiceAsync
Redis based implementation of ScheduledExecutorService
Author:
Nikita Koksharov
  • Method Details

    • schedule

      RScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
      Synchronously schedules a Runnable task for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
      Specified by:
      schedule in interface ScheduledExecutorService
      Parameters:
      command - the task to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      Returns:
      a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion
    • schedule

      RScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit)
      Synchronously schedules a Runnable task with defined timeToLive parameter for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
      Parameters:
      command - the task to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      timeToLive - - time to live interval
      ttlUnit - - unit of time to live interval
      Returns:
      a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion
    • schedule

      <V> RScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit)
      Synchronously schedules a value-returning task for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
      Specified by:
      schedule in interface ScheduledExecutorService
      Type Parameters:
      V - the type of the callable's result
      Parameters:
      callable - the function to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      Returns:
      a ScheduledFuture that can be used to extract result or cancel
    • schedule

      <V> RScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit)
      Synchronously schedules a value-returning task with defined timeToLive parameter for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task. The Future's get method will return the given result upon successful completion.
      Type Parameters:
      V - the type of the callable's result
      Parameters:
      callable - the function to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      timeToLive - - time to live interval
      ttlUnit - - unit of time to live interval
      Returns:
      a ScheduledFuture that can be used to extract result or cancel
    • scheduleAtFixedRate

      RScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
      Synchronously schedules a Runnable task for execution asynchronously after the given initialDelay, and subsequently with the given period. Subsequent executions are stopped if any execution of the task throws an exception. Otherwise, task could be terminated via cancellation or termination of the executor.
      Specified by:
      scheduleAtFixedRate in interface ScheduledExecutorService
      Parameters:
      command - the task to execute
      initialDelay - the time to delay first execution
      period - the period between successive executions
      unit - the time unit of the initialDelay and period parameters
      Returns:
      a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
    • scheduleWithFixedDelay

      RScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
      Synchronously schedules a Runnable task for execution asynchronously after the given initialDelay, and subsequently with the given delay started from the task finishing moment. Subsequent executions are stopped if any execution of the task throws an exception. Otherwise, task could be terminated via cancellation or termination of the executor.
      Specified by:
      scheduleWithFixedDelay in interface ScheduledExecutorService
      Parameters:
      command - the task to execute
      initialDelay - the time to delay first execution
      delay - the delay between the termination of one execution and the commencement of the next
      unit - the time unit of the initialDelay and delay parameters
      Returns:
      a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
    • schedule

      RScheduledFuture<?> schedule(Runnable task, CronSchedule cronSchedule)
      Synchronously schedules a Runnable task for execution asynchronously cron schedule object. Subsequent executions are stopped if any execution of the task throws an exception. Otherwise, task could be terminated via cancellation or termination of the executor.
      Parameters:
      task - - command the task to execute
      cronSchedule - - cron schedule object
      Returns:
      future object