Interface RScheduledExecutorServiceAsync

All Superinterfaces:
RExecutorServiceAsync
All Known Subinterfaces:
RScheduledExecutorService
All Known Implementing Classes:
RedissonExecutorService

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

    • scheduleAsync

      RScheduledFuture<?> scheduleAsync(Runnable task, long delay, TimeUnit unit)
      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.
      Parameters:
      task - the task to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      Returns:
      RScheduledFuture with listeners support
    • scheduleAsync

      RScheduledFuture<?> scheduleAsync(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
    • scheduleAsync

      RScheduledFuture<?> scheduleAsync(Runnable task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit)
      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:
      RScheduledFuture with listeners support
    • scheduleAsync

      RScheduledFuture<?> scheduleAsync(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
    • scheduleAsync

      <V> RScheduledFuture<V> scheduleAsync(Callable<V> task, long delay, TimeUnit unit)
      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.
      Type Parameters:
      V - the type of the callable's result
      Parameters:
      task - the function to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      Returns:
      RScheduledFuture with listeners support
    • scheduleAsync

      <V> RScheduledFuture<V> scheduleAsync(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
    • scheduleAsync

      <V> RScheduledFuture<V> scheduleAsync(Callable<V> task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit)
      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:
      task - 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:
      RScheduledFuture with listeners support
    • scheduleAsync

      <V> RScheduledFuture<V> scheduleAsync(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
    • scheduleAtFixedRateAsync

      RScheduledFuture<?> scheduleAtFixedRateAsync(Runnable task, long initialDelay, long period, TimeUnit unit)
      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.
      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:
      RScheduledFuture with listeners support
    • scheduleAtFixedRateAsync

      RScheduledFuture<?> scheduleAtFixedRateAsync(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
    • scheduleWithFixedDelayAsync

      RScheduledFuture<?> scheduleWithFixedDelayAsync(Runnable task, long initialDelay, long delay, TimeUnit unit)
      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.
      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:
      RScheduledFuture with listeners support
    • scheduleWithFixedDelayAsync

      RScheduledFuture<?> scheduleWithFixedDelayAsync(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
    • scheduleAsync

      RScheduledFuture<?> scheduleAsync(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:
      RScheduledFuture with listeners support
    • scheduleAsync

      RScheduledFuture<?> scheduleAsync(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