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(String id, Runnable task, Duration delay)
      Synchronously schedules a Runnable task with defined id for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Parameters:
      id - task id
      task - the task to execute
      delay - the time from now to delay execution
      Returns:
      a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion
    • schedule

      RScheduledFuture<?> schedule(Runnable task, 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:
      task - 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

      RScheduledFuture<?> schedule(String id, Runnable task, Duration delay, Duration timeToLive)
      Synchronously schedules a Runnable task with defined id and timeToLive parameters for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Parameters:
      id - task id
      task - the task to execute
      delay - the time from now to delay execution
      timeToLive - 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(String id, Callable<V> callable, Duration delay)
      Synchronously schedules a value-returning task with defined id for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Type Parameters:
      V - the type of the callable's result
      Parameters:
      id - task id
      callable - the function to execute
      delay - the time from now to delay execution
      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
    • schedule

      <V> RScheduledFuture<V> schedule(String id, Callable<V> callable, Duration delay, Duration timeToLive)
      Synchronously schedules a value-returning task with defined id and timeToLive parameters for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Type Parameters:
      V - the type of the callable's result
      Parameters:
      id - task id
      callable - the function to execute
      delay - the time from now to delay execution
      timeToLive - time to live interval
      Returns:
      a ScheduledFuture that can be used to extract result or cancel
    • scheduleAtFixedRate

      RScheduledFuture<?> scheduleAtFixedRate(Runnable task, 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:
      task - 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
    • scheduleAtFixedRate

      RScheduledFuture<?> scheduleAtFixedRate(String id, Runnable task, Duration initialDelay, Duration period)
      Synchronously schedules a Runnable task with defined id 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.
      Parameters:
      id - task id
      task - the task to execute
      initialDelay - the time to delay first execution
      period - the period between successive executions
      Returns:
      a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
    • scheduleWithFixedDelay

      RScheduledFuture<?> scheduleWithFixedDelay(Runnable task, 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:
      task - 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
    • scheduleWithFixedDelay

      RScheduledFuture<?> scheduleWithFixedDelay(String id, Runnable task, Duration initialDelay, Duration delay)
      Synchronously schedules a Runnable task with specified id 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.
      Parameters:
      id - task id
      task - 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
      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 - the task to execute
      cronSchedule - cron schedule object
      Returns:
      future object
    • schedule

      RScheduledFuture<?> schedule(String id, Runnable task, CronSchedule cronSchedule)
      Synchronously schedules a Runnable task with defined id 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:
      id - task id
      task - the task to execute
      cronSchedule - cron schedule object
      Returns:
      future object