Package org.redisson

Class RedissonExecutorService

java.lang.Object
org.redisson.RedissonExecutorService
All Implemented Interfaces:
Executor, ExecutorService, ScheduledExecutorService, RExecutorService, RExecutorServiceAsync, RScheduledExecutorService, RScheduledExecutorServiceAsync

public class RedissonExecutorService extends Object implements RScheduledExecutorService
Author:
Nikita Koksharov
  • Field Details

  • Constructor Details

  • Method Details

    • generateActiveWorkersId

      protected String generateActiveWorkersId()
    • getTaskCount

      public int getTaskCount()
      Description copied from interface: RExecutorService
      Returns amount of tasks awaiting execution or currently in execution.
      Specified by:
      getTaskCount in interface RExecutorService
      Returns:
      amount of tasks
    • getTaskCountAsync

      public RFuture<Integer> getTaskCountAsync()
      Description copied from interface: RExecutorServiceAsync
      Returns amount of tasks awaiting execution or currently in execution.
      Specified by:
      getTaskCountAsync in interface RExecutorServiceAsync
      Returns:
      amount of tasks
    • hasTask

      public boolean hasTask(String taskId)
      Description copied from interface: RExecutorService
      Returns true if this Executor Service has task by taskId awaiting execution or currently in execution.
      Specified by:
      hasTask in interface RExecutorService
      Parameters:
      taskId - id of task
      Returns:
      true if this Executor Service has task
    • getTaskIds

      public Set<String> getTaskIds()
      Description copied from interface: RExecutorService
      Returns list of task ids awaiting execution or currently in execution.
      Specified by:
      getTaskIds in interface RExecutorService
      Returns:
      task ids
    • getTaskIdsAsync

      public RFuture<Set<String>> getTaskIdsAsync()
      Description copied from interface: RExecutorServiceAsync
      Returns list of task ids awaiting execution or currently in execution.
      Specified by:
      getTaskIdsAsync in interface RExecutorServiceAsync
      Returns:
      task ids
    • hasTaskAsync

      public RFuture<Boolean> hasTaskAsync(String taskId)
      Description copied from interface: RExecutorServiceAsync
      Returns true if this Executor Service has task by taskId awaiting execution or currently in execution
      Specified by:
      hasTaskAsync in interface RExecutorServiceAsync
      Parameters:
      taskId - id of task
      Returns:
      true if this Executor Service has task
    • countActiveWorkers

      public int countActiveWorkers()
      Description copied from interface: RExecutorService
      Returns active workers amount available for tasks execution.
      Specified by:
      countActiveWorkers in interface RExecutorService
      Returns:
      workers amount
    • registerWorkers

      public void registerWorkers(int workers)
      Specified by:
      registerWorkers in interface RExecutorService
    • registerWorkers

      public void registerWorkers(WorkerOptions options)
      Description copied from interface: RExecutorService
      Register workers
      Specified by:
      registerWorkers in interface RExecutorService
      Parameters:
      options - - worker options
    • registerWorkers

      public void registerWorkers(int workers, ExecutorService executor)
      Specified by:
      registerWorkers in interface RExecutorService
    • execute

      public void execute(Runnable task)
      Specified by:
      execute in interface Executor
    • execute

      public void execute(Runnable... tasks)
      Description copied from interface: RExecutorService
      Submits tasks batch for execution synchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
      Specified by:
      execute in interface RExecutorService
      Parameters:
      tasks - tasks to execute
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface ExecutorService
    • getName

      public String getName()
      Description copied from interface: RExecutorService
      Returns executor name
      Specified by:
      getName in interface RExecutorService
      Returns:
      name of service
    • delete

      public boolean delete()
      Description copied from interface: RExecutorService
      Deletes executor request queue and state objects
      Specified by:
      delete in interface RExecutorService
      Returns:
      true if any of objects were deleted
    • deleteAsync

      public RFuture<Boolean> deleteAsync()
      Description copied from interface: RExecutorServiceAsync
      Deletes executor request queue and state objects
      Specified by:
      deleteAsync in interface RExecutorServiceAsync
      Returns:
      true if any of objects were deleted
    • shutdownNow

      public List<Runnable> shutdownNow()
      Specified by:
      shutdownNow in interface ExecutorService
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface ExecutorService
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface ExecutorService
    • awaitTermination

      public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface ExecutorService
      Throws:
      InterruptedException
    • submit

      public <T> RExecutorFuture<T> submit(Callable<T> task)
      Description copied from interface: RExecutorService
      Synchronously submits a value-returning task for execution asynchronously and returns a Future representing the pending results of the task. The Future's get method will return the task's result upon successful completion.
      Specified by:
      submit in interface ExecutorService
      Specified by:
      submit in interface RExecutorService
      Type Parameters:
      T - the type of the task's result
      Parameters:
      task - the task to submit
      Returns:
      a Future representing pending completion of the task
    • submit

      public <T> RExecutorFuture<T> submit(Callable<T> task, long timeToLive, TimeUnit timeUnit)
      Description copied from interface: RExecutorService
      Synchronously submits a value-returning task with defined timeToLive parameter for execution asynchronously. Returns a Future representing the pending results of the task. The Future's get method will return the task's result upon successful completion.
      Specified by:
      submit in interface RExecutorService
      Type Parameters:
      T - the type of the task's result
      Parameters:
      task - the task to submit
      timeToLive - time to live interval
      timeUnit - unit of time to live interval
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public <T> RExecutorFuture<T> submitAsync(Callable<T> task, long timeToLive, TimeUnit timeUnit)
      Description copied from interface: RExecutorServiceAsync
      Submits a value-returning task with defined timeToLive parameter for execution asynchronously. Returns a Future representing the pending results of the task. The Future's get method will return the task's result upon successful completion.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Type Parameters:
      T - the type of the task's result
      Parameters:
      task - the task to submit
      timeToLive - time to live interval
      timeUnit - unit of time to live interval
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public <T> RExecutorFuture<T> submitAsync(Callable<T> task)
      Description copied from interface: RExecutorServiceAsync
      Submits task for execution asynchronously
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Type Parameters:
      T - type of return value
      Parameters:
      task - task to execute
      Returns:
      Future object
    • submit

      public RExecutorBatchFuture submit(Callable<?>... tasks)
      Description copied from interface: RExecutorService
      Synchronously submits tasks batch for execution asynchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
      Specified by:
      submit in interface RExecutorService
      Parameters:
      tasks - - tasks to execute
      Returns:
      Future object
    • createTaskParameters

      protected TaskParameters createTaskParameters(Callable<?> task)
    • createTaskParameters

      protected TaskParameters createTaskParameters(String taskId, Callable<?> task)
    • createTaskParameters

      protected TaskParameters createTaskParameters(Runnable task)
    • createTaskParameters

      protected TaskParameters createTaskParameters(String taskId, Runnable task)
    • submitAsync

      public RExecutorBatchFuture submitAsync(Callable<?>... tasks)
      Description copied from interface: RExecutorServiceAsync
      Submits tasks batch for execution asynchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Parameters:
      tasks - tasks to execute
      Returns:
      Future object
    • submit

      public <T> RExecutorFuture<T> submit(Runnable task, T result)
      Description copied from interface: RExecutorService
      Synchronously submits a Runnable task for execution asynchronously and returns a RExecutorFuture representing that task. The Future's get method will return the given result upon successful completion.
      Specified by:
      submit in interface ExecutorService
      Specified by:
      submit in interface RExecutorService
      Type Parameters:
      T - the type of the result
      Parameters:
      task - the task to submit
      result - the result to return
      Returns:
      a Future representing pending completion of the task
    • submit

      public RExecutorBatchFuture submit(Runnable... tasks)
      Description copied from interface: RExecutorService
      Synchronously submits tasks batch for execution asynchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
      Specified by:
      submit in interface RExecutorService
      Parameters:
      tasks - - tasks to execute
      Returns:
      Future object
    • submitAsync

      public RExecutorBatchFuture submitAsync(Runnable... tasks)
      Description copied from interface: RExecutorServiceAsync
      Submits tasks batch for execution asynchronously. All tasks are stored to executor request queue atomically, if case of any error none of tasks will be added.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Parameters:
      tasks - tasks to execute
      Returns:
      Future object
    • submit

      public RExecutorFuture<?> submit(Runnable task)
      Description copied from interface: RExecutorService
      Synchronously submits a Runnable task for execution asynchronously. Returns a RExecutorFuture representing task completion. The Future's get method will return null upon successful completion.
      Specified by:
      submit in interface ExecutorService
      Specified by:
      submit in interface RExecutorService
      Parameters:
      task - the task to submit
      Returns:
      a Future representing pending completion of the task
    • submit

      public RExecutorFuture<?> submit(Runnable task, long timeToLive, TimeUnit timeUnit)
      Description copied from interface: RExecutorService
      Synchronously submits a task with defined timeToLive parameter for execution asynchronously. Returns a Future representing task completion. The Future's get method will return the task's result upon successful completion.
      Specified by:
      submit in interface RExecutorService
      Parameters:
      task - the task to submit
      timeToLive - time to live interval
      timeUnit - unit of time to live interval
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public RExecutorFuture<?> submitAsync(Runnable task, long timeToLive, TimeUnit timeUnit)
      Description copied from interface: RExecutorServiceAsync
      Submits a task with defined timeToLive parameter for execution asynchronously. Returns a Future representing task completion. The Future's get method will return the task's result upon successful completion.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Parameters:
      task - the task to submit
      timeToLive - time to live interval
      timeUnit - unit of time to live interval
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public RExecutorFuture<?> submitAsync(Runnable task)
      Description copied from interface: RExecutorServiceAsync
      Submits task for execution asynchronously
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Parameters:
      task - - task to execute
      Returns:
      Future object
    • schedule

      public RScheduledFuture<?> schedule(Runnable task, long delay, TimeUnit unit)
      Description copied from interface: RScheduledExecutorService
      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 RScheduledExecutorService
      Specified by:
      schedule in interface ScheduledExecutorService
      Parameters:
      task - 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
    • scheduleAsync

      public RScheduledFuture<?> scheduleAsync(Runnable task, long delay, TimeUnit unit)
      Description copied from interface: RScheduledExecutorServiceAsync
      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:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      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
    • schedule

      public <V> RScheduledFuture<V> schedule(Callable<V> task, long delay, TimeUnit unit)
      Description copied from interface: RScheduledExecutorService
      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 RScheduledExecutorService
      Specified by:
      schedule in interface ScheduledExecutorService
      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:
      a ScheduledFuture that can be used to extract result or cancel
    • scheduleAsync

      public <V> RScheduledFuture<V> scheduleAsync(Callable<V> task, long delay, TimeUnit unit)
      Description copied from interface: RScheduledExecutorServiceAsync
      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:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      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
    • schedule

      public RScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit, long ttl, TimeUnit ttlUnit)
      Description copied from interface: RScheduledExecutorService
      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.
      Specified by:
      schedule in interface RScheduledExecutorService
      Parameters:
      command - the task to execute
      delay - the time from now to delay execution
      unit - the time unit of the delay parameter
      ttl - 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
    • scheduleAsync

      public RScheduledFuture<?> scheduleAsync(Runnable task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit)
      Description copied from interface: RScheduledExecutorServiceAsync
      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.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      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
    • schedule

      public <V> RScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit)
      Description copied from interface: RScheduledExecutorService
      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.
      Specified by:
      schedule in interface RScheduledExecutorService
      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
    • scheduleAsync

      public <V> RScheduledFuture<V> scheduleAsync(Callable<V> task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit)
      Description copied from interface: RScheduledExecutorServiceAsync
      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.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      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
    • scheduleAtFixedRate

      public RScheduledFuture<?> scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)
      Description copied from interface: RScheduledExecutorService
      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 RScheduledExecutorService
      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
    • scheduleAtFixedRateAsync

      public RScheduledFuture<?> scheduleAtFixedRateAsync(Runnable task, long initialDelay, long period, TimeUnit unit)
      Description copied from interface: RScheduledExecutorServiceAsync
      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:
      scheduleAtFixedRateAsync in interface RScheduledExecutorServiceAsync
      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
    • schedule

      public RScheduledFuture<?> schedule(Runnable task, CronSchedule cronSchedule)
      Description copied from interface: RScheduledExecutorService
      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.
      Specified by:
      schedule in interface RScheduledExecutorService
      Parameters:
      task - the task to execute
      cronSchedule - cron schedule object
      Returns:
      future object
    • scheduleAsync

      public RScheduledFuture<?> scheduleAsync(Runnable task, CronSchedule cronSchedule)
      Description copied from interface: RScheduledExecutorServiceAsync
      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.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      Parameters:
      task - the task to execute
      cronSchedule - cron schedule object
      Returns:
      RScheduledFuture with listeners support
    • scheduleWithFixedDelay

      public RScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit)
      Description copied from interface: RScheduledExecutorService
      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 RScheduledExecutorService
      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
    • scheduleWithFixedDelayAsync

      public RScheduledFuture<?> scheduleWithFixedDelayAsync(Runnable task, long initialDelay, long delay, TimeUnit unit)
      Description copied from interface: RScheduledExecutorServiceAsync
      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:
      scheduleWithFixedDelayAsync in interface RScheduledExecutorServiceAsync
      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
    • cancelTask

      public Boolean cancelTask(String taskId)
      Description copied from interface: RExecutorService
      Cancel task by id
      Specified by:
      cancelTask in interface RExecutorService
      Parameters:
      taskId - id of task
      Returns:
      true if task has been canceled successfully or null if task wasn't found
      See Also:
    • cancelTaskAsync

      public RFuture<Boolean> cancelTaskAsync(String taskId)
      Description copied from interface: RExecutorServiceAsync
      Cancel task by id
      Specified by:
      cancelTaskAsync in interface RExecutorServiceAsync
      Parameters:
      taskId - id of task
      Returns:
      true if task has been canceled successfully or null if task wasn't found
      See Also:
    • invokeAny

      public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
      Specified by:
      invokeAny in interface ExecutorService
      Throws:
      InterruptedException
      ExecutionException
    • invokeAny

      public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
      Specified by:
      invokeAny in interface ExecutorService
      Throws:
      InterruptedException
      ExecutionException
      TimeoutException
    • invokeAll

      public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
      Specified by:
      invokeAll in interface ExecutorService
      Throws:
      InterruptedException
    • invokeAll

      public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
      Specified by:
      invokeAll in interface ExecutorService
      Throws:
      InterruptedException
    • submit

      public <T> RExecutorFuture<T> submit(String id, Callable<T> task)
      Description copied from interface: RExecutorService
      Synchronously submits a value-returning task with specified id for execution asynchronously. Returns a Future representing the pending results of the task.
      Specified by:
      submit in interface RExecutorService
      Type Parameters:
      T - the type of the task's result
      Parameters:
      id - task id
      task - the task to submit
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public <T> RExecutorFuture<T> submitAsync(String id, Callable<T> task)
      Description copied from interface: RExecutorServiceAsync
      Synchronously submits a value-returning task with specified id for execution asynchronously. Returns a Future representing the pending results of the task.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Type Parameters:
      T - the type of the task's result
      Parameters:
      id - task id
      task - the task to submit
      Returns:
      a Future representing pending completion of the task
    • submit

      public <T> RExecutorFuture<T> submit(String id, Callable<T> task, Duration timeToLive)
      Description copied from interface: RExecutorService
      Synchronously submits a value-returning task with defined id and timeToLive parameters for execution asynchronously. Returns a Future representing the pending results of the task.
      Specified by:
      submit in interface RExecutorService
      Type Parameters:
      T - the type of the task's result
      Parameters:
      id - task id
      task - the task to submit
      timeToLive - time to live interval
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public <T> RExecutorFuture<T> submitAsync(String id, Callable<T> task, Duration timeToLive)
      Description copied from interface: RExecutorServiceAsync
      Synchronously submits a value-returning task with defined id and timeToLive parameters for execution asynchronously. Returns a Future representing the pending results of the task.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Type Parameters:
      T - the type of the task's result
      Parameters:
      id - task id
      task - the task to submit
      timeToLive - time to live interval
      Returns:
      a Future representing pending completion of the task
    • submit

      public RExecutorFuture<?> submit(String id, Runnable task, Duration timeToLive)
      Description copied from interface: RExecutorService
      Synchronously submits a task with defined id and timeToLive parameters for execution asynchronously. Returns a Future representing task completion.
      Specified by:
      submit in interface RExecutorService
      Parameters:
      id - task id
      task - the task to submit
      timeToLive - time to live interval
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public RExecutorFuture<?> submitAsync(String id, Runnable task, Duration timeToLive)
      Description copied from interface: RExecutorServiceAsync
      Synchronously submits a task with defined id and timeToLive parameters for execution asynchronously. Returns a Future representing task completion.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Parameters:
      id - task id
      task - the task to submit
      timeToLive - time to live interval
      Returns:
      a Future representing pending completion of the task
    • submit

      public RExecutorFuture<?> submit(String id, Runnable task)
      Description copied from interface: RExecutorService
      Synchronously submits a Runnable task with id for execution asynchronously. Returns a RExecutorFuture representing task completion.
      Specified by:
      submit in interface RExecutorService
      Parameters:
      id - task id
      task - the task to submit
      Returns:
      a Future representing pending completion of the task
    • submitAsync

      public RExecutorFuture<?> submitAsync(String id, Runnable task)
      Description copied from interface: RExecutorServiceAsync
      Synchronously submits a Runnable task with id for execution asynchronously. Returns a RExecutorFuture representing task completion.
      Specified by:
      submitAsync in interface RExecutorServiceAsync
      Parameters:
      id - task id
      task - the task to submit
      Returns:
      a Future representing pending completion of the task
    • schedule

      public RScheduledFuture<?> schedule(String id, Runnable command, Duration delay)
      Description copied from interface: RScheduledExecutorService
      Synchronously schedules a Runnable task with defined id for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Specified by:
      schedule in interface RScheduledExecutorService
      Parameters:
      id - task id
      command - 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

      public RScheduledFuture<?> scheduleAsync(String id, Runnable task, Duration delay)
      Description copied from interface: RScheduledExecutorServiceAsync
      Synchronously schedules a Runnable task with defined id for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      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

      public RScheduledFuture<?> schedule(String id, Runnable command, Duration delay, Duration timeToLive)
      Description copied from interface: RScheduledExecutorService
      Synchronously schedules a Runnable task with defined id and timeToLive parameters for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Specified by:
      schedule in interface RScheduledExecutorService
      Parameters:
      id - task id
      command - 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

      public RScheduledFuture<?> scheduleAsync(String id, Runnable task, Duration delay, Duration timeToLive)
      Description copied from interface: RScheduledExecutorServiceAsync
      Synchronously schedules a Runnable task with defined id and timeToLive parameters for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      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

      public <V> RScheduledFuture<V> schedule(String id, Callable<V> callable, Duration delay)
      Description copied from interface: RScheduledExecutorService
      Synchronously schedules a value-returning task with defined id for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Specified by:
      schedule in interface RScheduledExecutorService
      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

      public <V> RScheduledFuture<V> scheduleAsync(String id, Callable<V> task, Duration delay)
      Description copied from interface: RScheduledExecutorServiceAsync
      Synchronously schedules a value-returning task with defined id for execution asynchronously after the given delay. Returns a RScheduledFuture representing that task.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      Type Parameters:
      V - the type of the callable's result
      Parameters:
      id - task id
      task - 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

      public <V> RScheduledFuture<V> schedule(String id, Callable<V> callable, Duration delay, Duration timeToLive)
      Description copied from interface: RScheduledExecutorService
      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.
      Specified by:
      schedule in interface RScheduledExecutorService
      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
    • scheduleAsync

      public <V> RScheduledFuture<V> scheduleAsync(String id, Callable<V> task, Duration delay, Duration timeToLive)
      Description copied from interface: RScheduledExecutorServiceAsync
      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.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      Type Parameters:
      V - the type of the callable's result
      Parameters:
      id - task id
      task - 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

      public RScheduledFuture<?> scheduleAtFixedRate(String id, Runnable command, Duration initialDelay, Duration period)
      Description copied from interface: RScheduledExecutorService
      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.
      Specified by:
      scheduleAtFixedRate in interface RScheduledExecutorService
      Parameters:
      id - task id
      command - 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
    • scheduleAtFixedRateAsync

      public RScheduledFuture<?> scheduleAtFixedRateAsync(String id, Runnable task, Duration initialDelay, Duration period)
      Description copied from interface: RScheduledExecutorServiceAsync
      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.
      Specified by:
      scheduleAtFixedRateAsync in interface RScheduledExecutorServiceAsync
      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

      public RScheduledFuture<?> scheduleWithFixedDelay(String id, Runnable command, Duration initialDelay, Duration delay)
      Description copied from interface: RScheduledExecutorService
      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.
      Specified by:
      scheduleWithFixedDelay in interface RScheduledExecutorService
      Parameters:
      id - task id
      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
      Returns:
      a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
    • scheduleWithFixedDelayAsync

      public RScheduledFuture<?> scheduleWithFixedDelayAsync(String id, Runnable task, Duration initialDelay, Duration delay)
      Description copied from interface: RScheduledExecutorServiceAsync
      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.
      Specified by:
      scheduleWithFixedDelayAsync in interface RScheduledExecutorServiceAsync
      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

      public RScheduledFuture<?> schedule(String id, Runnable task, CronSchedule cronSchedule)
      Description copied from interface: RScheduledExecutorService
      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.
      Specified by:
      schedule in interface RScheduledExecutorService
      Parameters:
      id - task id
      task - the task to execute
      cronSchedule - cron schedule object
      Returns:
      future object
    • scheduleAsync

      public RScheduledFuture<?> scheduleAsync(String id, Runnable task, CronSchedule cronSchedule)
      Description copied from interface: RScheduledExecutorServiceAsync
      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.
      Specified by:
      scheduleAsync in interface RScheduledExecutorServiceAsync
      Parameters:
      id - task id
      task - the task to execute
      cronSchedule - cron schedule object
      Returns:
      future object