Package org.redisson.api
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
-
Field Summary
Fields inherited from interface org.redisson.api.RExecutorService
MAPREDUCE_NAME -
Method Summary
Modifier and TypeMethodDescriptionSynchronously schedules a Runnable task for execution asynchronously after the givendelay.Synchronously schedules a Runnable task with definedtimeToLiveparameter for execution asynchronously after the givendelay.schedule(Runnable task, CronSchedule cronSchedule) Synchronously schedules a Runnable task for execution asynchronously cron schedule object.Synchronously schedules a Runnable task with definedidfor execution asynchronously after the givendelay.Synchronously schedules a Runnable task with definedidandtimeToLiveparameters for execution asynchronously after the givendelay.schedule(String id, Runnable task, CronSchedule cronSchedule) Synchronously schedules a Runnable task with definedidfor execution asynchronously cron schedule object.<V> RScheduledFuture<V> Synchronously schedules a value-returning task with definedidfor execution asynchronously after the givendelay.<V> RScheduledFuture<V> Synchronously schedules a value-returning task with definedidandtimeToLiveparameters for execution asynchronously after the givendelay.<V> RScheduledFuture<V> Synchronously schedules a value-returning task for execution asynchronously after the givendelay.<V> RScheduledFuture<V> Synchronously schedules a value-returning task with definedtimeToLiveparameter for execution asynchronously after the givendelay.scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit) Synchronously schedules a Runnable task for execution asynchronously after the giveninitialDelay, and subsequently with the givenperiod.scheduleAtFixedRate(String id, Runnable task, Duration initialDelay, Duration period) Synchronously schedules a Runnable task with definedidfor execution asynchronously after the giveninitialDelay, and subsequently with the givenperiod.scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) Synchronously schedules a Runnable task for execution asynchronously after the giveninitialDelay, and subsequently with the givendelaystarted from the task finishing moment.scheduleWithFixedDelay(String id, Runnable task, Duration initialDelay, Duration delay) Synchronously schedules a Runnable task with specifiedidfor execution asynchronously after the giveninitialDelay, and subsequently with the givendelaystarted from the task finishing moment.Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNowMethods inherited from interface org.redisson.api.RExecutorService
cancelTask, countActiveWorkers, delete, execute, getName, getTaskCount, getTaskIds, hasTask, registerWorkers, registerWorkers, registerWorkers, submit, submit, submit, submit, submit, submit, submit, submit, submit, submit, submitMethods inherited from interface org.redisson.api.RExecutorServiceAsync
cancelTaskAsync, deleteAsync, getTaskCountAsync, getTaskIdsAsync, hasTaskAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsyncMethods inherited from interface org.redisson.api.RScheduledExecutorServiceAsync
scheduleAsync, scheduleAsync, scheduleAsync, scheduleAsync, scheduleAsync, scheduleAsync, scheduleAsync, scheduleAsync, scheduleAsync, scheduleAsync, scheduleAtFixedRateAsync, scheduleAtFixedRateAsync, scheduleWithFixedDelayAsync, scheduleWithFixedDelayAsync
-
Method Details
-
schedule
Synchronously schedules a Runnable task for execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task. The Future'sgetmethod will return the given result upon successful completion.- Specified by:
schedulein interfaceScheduledExecutorService- Parameters:
command- the task to executedelay- the time from now to delay executionunit- the time unit of the delay parameter- Returns:
- a ScheduledFuture representing pending completion of
the task and whose
get()method will returnnullupon completion
-
schedule
Synchronously schedules a Runnable task with definedidfor execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task.- Parameters:
id- task idtask- the task to executedelay- the time from now to delay execution- Returns:
- a ScheduledFuture representing pending completion of
the task and whose
get()method will returnnullupon completion
-
schedule
RScheduledFuture<?> schedule(Runnable task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit) Synchronously schedules a Runnable task with definedtimeToLiveparameter for execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task. The Future'sgetmethod will return the given result upon successful completion.- Parameters:
task- the task to executedelay- the time from now to delay executionunit- the time unit of the delay parametertimeToLive- time to live intervalttlUnit- unit of time to live interval- Returns:
- a ScheduledFuture representing pending completion of
the task and whose
get()method will returnnullupon completion
-
schedule
Synchronously schedules a Runnable task with definedidandtimeToLiveparameters for execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task.- Parameters:
id- task idtask- the task to executedelay- the time from now to delay executiontimeToLive- time to live interval- Returns:
- a ScheduledFuture representing pending completion of
the task and whose
get()method will returnnullupon completion
-
schedule
Synchronously schedules a value-returning task for execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task. The Future'sgetmethod will return the given result upon successful completion.- Specified by:
schedulein interfaceScheduledExecutorService- Type Parameters:
V- the type of the callable's result- Parameters:
callable- the function to executedelay- the time from now to delay executionunit- the time unit of the delay parameter- Returns:
- a ScheduledFuture that can be used to extract result or cancel
-
schedule
Synchronously schedules a value-returning task with definedidfor execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task.- Type Parameters:
V- the type of the callable's result- Parameters:
id- task idcallable- the function to executedelay- 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 definedtimeToLiveparameter for execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task. The Future'sgetmethod will return the given result upon successful completion.- Type Parameters:
V- the type of the callable's result- Parameters:
callable- the function to executedelay- the time from now to delay executionunit- the time unit of the delay parametertimeToLive- time to live intervalttlUnit- 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 definedidandtimeToLiveparameters for execution asynchronously after the givendelay. Returns a RScheduledFuture representing that task.- Type Parameters:
V- the type of the callable's result- Parameters:
id- task idcallable- the function to executedelay- the time from now to delay executiontimeToLive- 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 giveninitialDelay, and subsequently with the givenperiod. 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:
scheduleAtFixedRatein interfaceScheduledExecutorService- Parameters:
task- the task to executeinitialDelay- the time to delay first executionperiod- the period between successive executionsunit- 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 definedidfor execution asynchronously after the giveninitialDelay, and subsequently with the givenperiod. 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 idtask- the task to executeinitialDelay- the time to delay first executionperiod- 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 giveninitialDelay, and subsequently with the givendelaystarted 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:
scheduleWithFixedDelayin interfaceScheduledExecutorService- Parameters:
task- the task to executeinitialDelay- the time to delay first executiondelay- the delay between the termination of one execution and the commencement of the nextunit- 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 specifiedidfor execution asynchronously after the giveninitialDelay, and subsequently with the givendelaystarted 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 idtask- the task to executeinitialDelay- the time to delay first executiondelay- 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
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 executecronSchedule- cron schedule object- Returns:
- future object
-
schedule
Synchronously schedules a Runnable task with definedidfor 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 idtask- the task to executecronSchedule- cron schedule object- Returns:
- future object
-