Package org.redisson.api
Interface RScheduledExecutorServiceAsync
- All Superinterfaces:
RExecutorServiceAsync
- All Known Subinterfaces:
RScheduledExecutorService
- All Known Implementing Classes:
RedissonExecutorService
Redis based implementation of
ScheduledExecutorService
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionscheduleAsync
(Runnable task, long delay, TimeUnit unit) Schedules a Runnable task for execution asynchronously after the givendelay
.scheduleAsync
(Runnable task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit) Schedules a Runnable task with definedtimeToLive
parameter for execution asynchronously after the givendelay
.scheduleAsync
(Runnable task, CronSchedule cronSchedule) Synchronously schedules a Runnable task for execution asynchronously cron schedule object.<V> RScheduledFuture<V>
scheduleAsync
(Callable<V> task, long delay, TimeUnit unit) Schedules a value-returning task for execution asynchronously after the givendelay
.<V> RScheduledFuture<V>
scheduleAsync
(Callable<V> task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit) Schedules a value-returning task with definedtimeToLive
parameter for execution asynchronously after the givendelay
.scheduleAtFixedRateAsync
(Runnable task, long initialDelay, long period, TimeUnit unit) Schedules a Runnable task for execution asynchronously after the giveninitialDelay
, and subsequently with the givenperiod
.scheduleWithFixedDelayAsync
(Runnable task, long initialDelay, long delay, TimeUnit unit) Schedules a Runnable task for execution asynchronously after the giveninitialDelay
, and subsequently with the givendelay
started from the task finishing moment.Methods inherited from interface org.redisson.api.RExecutorServiceAsync
cancelTaskAsync, deleteAsync, getTaskCountAsync, getTaskIdsAsync, hasTaskAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync
-
Method Details
-
scheduleAsync
Schedules a Runnable task for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task. The Future'sget
method 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 parameter- Returns:
- RScheduledFuture with listeners support
-
scheduleAsync
RScheduledFuture<?> scheduleAsync(Runnable task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit) Schedules a Runnable task with definedtimeToLive
parameter for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task. The Future'sget
method 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:
- RScheduledFuture with listeners support
-
scheduleAsync
Schedules a value-returning task for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task. The Future'sget
method will return the given result upon successful completion.- Type Parameters:
V
- the type of the callable's result- Parameters:
task
- the function to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameter- Returns:
- RScheduledFuture with listeners support
-
scheduleAsync
<V> RScheduledFuture<V> scheduleAsync(Callable<V> task, long delay, TimeUnit unit, long timeToLive, TimeUnit ttlUnit) Schedules a value-returning task with definedtimeToLive
parameter for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task. The Future'sget
method will return the given result upon successful completion.- Type Parameters:
V
- the type of the callable's result- Parameters:
task
- 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:
- RScheduledFuture with listeners support
-
scheduleAtFixedRateAsync
RScheduledFuture<?> scheduleAtFixedRateAsync(Runnable task, long initialDelay, long period, TimeUnit unit) 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.- 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:
- RScheduledFuture with listeners support
-
scheduleWithFixedDelayAsync
RScheduledFuture<?> scheduleWithFixedDelayAsync(Runnable task, long initialDelay, long delay, TimeUnit unit) Schedules a Runnable task for execution asynchronously after the giveninitialDelay
, and subsequently with the givendelay
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 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:
- RScheduledFuture with listeners support
-
scheduleAsync
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:
- RScheduledFuture with listeners support
-