Package org.redisson
Class RedissonExecutorService
java.lang.Object
org.redisson.RedissonExecutorService
- All Implemented Interfaces:
Executor
,ExecutorService
,ScheduledExecutorService
,RExecutorService
,RExecutorServiceAsync
,RScheduledExecutorService
,RScheduledExecutorServiceAsync
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
Fields inherited from interface org.redisson.api.RExecutorService
MAPREDUCE_NAME
-
Constructor Summary
ConstructorDescriptionRedissonExecutorService
(Codec codec, CommandAsyncExecutor commandExecutor, Redisson redisson, String name, QueueTransferService queueTransferService, ConcurrentMap<String, ResponseEntry> responses, ExecutorOptions options) -
Method Summary
Modifier and TypeMethodDescriptionboolean
awaitTermination
(long timeout, TimeUnit unit) cancelTask
(String taskId) Cancel task by idcancelTaskAsync
(String taskId) Cancel task by idint
Returns active workers amount available for tasks execution.protected TaskParameters
createTaskParameters
(Runnable task) protected TaskParameters
createTaskParameters
(String taskId, Runnable task) protected TaskParameters
createTaskParameters
(String taskId, Callable<?> task) protected TaskParameters
createTaskParameters
(Callable<?> task) boolean
delete()
Deletes executor request queue and state objectsDeletes executor request queue and state objectsvoid
void
Submits tasks batch for execution synchronously.getName()
Returns executor nameint
Returns amount of tasks awaiting execution or currently in execution.Returns amount of tasks awaiting execution or currently in execution.Returns list of task ids awaiting execution or currently in execution.Returns list of task ids awaiting execution or currently in execution.boolean
Returnstrue
if this Executor Service has task bytaskId
awaiting execution or currently in execution.hasTaskAsync
(String taskId) Returnstrue
if this Executor Service has task bytaskId
awaiting execution or currently in executioninvokeAll
(Collection<? extends Callable<T>> tasks) invokeAll
(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> T
invokeAny
(Collection<? extends Callable<T>> tasks) <T> T
invokeAny
(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) boolean
boolean
void
registerWorkers
(int workers) void
registerWorkers
(int workers, ExecutorService executor) void
registerWorkers
(WorkerOptions options) Register workersSynchronously schedules a Runnable task for execution asynchronously after the givendelay
.Synchronously schedules a Runnable task with definedtimeToLive
parameter 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 definedid
for execution asynchronously after the givendelay
.Synchronously schedules a Runnable task with definedid
andtimeToLive
parameters for execution asynchronously after the givendelay
.schedule
(String id, Runnable task, CronSchedule cronSchedule) Synchronously schedules a Runnable task with definedid
for execution asynchronously cron schedule object.<V> RScheduledFuture<V>
Synchronously schedules a value-returning task with definedid
for execution asynchronously after the givendelay
.<V> RScheduledFuture<V>
Synchronously schedules a value-returning task with definedid
andtimeToLive
parameters 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 definedtimeToLive
parameter for execution asynchronously after the givendelay
.scheduleAsync
(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.scheduleAsync
(String id, Runnable task, Duration delay) Synchronously schedules a Runnable task with definedid
for execution asynchronously after the givendelay
.scheduleAsync
(String id, Runnable task, Duration delay, Duration timeToLive) Synchronously schedules a Runnable task with definedid
andtimeToLive
parameters for execution asynchronously after the givendelay
.scheduleAsync
(String id, Runnable task, CronSchedule cronSchedule) Synchronously schedules a Runnable task with definedid
for execution asynchronously cron schedule object.<V> RScheduledFuture<V>
scheduleAsync
(String id, Callable<V> task, Duration delay) Synchronously schedules a value-returning task with definedid
for execution asynchronously after the givendelay
.<V> RScheduledFuture<V>
scheduleAsync
(String id, Callable<V> task, Duration delay, Duration timeToLive) Synchronously schedules a value-returning task with definedid
andtimeToLive
parameters for execution asynchronously after the givendelay
.<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
.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 command, Duration initialDelay, Duration period) Synchronously schedules a Runnable task with definedid
for execution asynchronously after the giveninitialDelay
, and subsequently with the givenperiod
.scheduleAtFixedRateAsync
(Runnable task, long initialDelay, long period, TimeUnit unit) Schedules a Runnable task for execution asynchronously after the giveninitialDelay
, and subsequently with the givenperiod
.scheduleAtFixedRateAsync
(String id, Runnable task, Duration initialDelay, Duration period) Synchronously schedules a Runnable task with definedid
for 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 givendelay
started from the task finishing moment.scheduleWithFixedDelay
(String id, Runnable command, Duration initialDelay, Duration delay) Synchronously schedules a Runnable task with specifiedid
for execution asynchronously after the giveninitialDelay
, and subsequently with the givendelay
started from the task finishing moment.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.scheduleWithFixedDelayAsync
(String id, Runnable task, Duration initialDelay, Duration delay) Synchronously schedules a Runnable task with specifiedid
for execution asynchronously after the giveninitialDelay
, and subsequently with the givendelay
started from the task finishing moment.void
shutdown()
Synchronously submits a Runnable task for execution asynchronously.Synchronously submits tasks batch for execution asynchronously.Synchronously submits a task with definedtimeToLive
parameter for execution asynchronously.<T> RExecutorFuture<T>
Synchronously submits a Runnable task for execution asynchronously and returns a RExecutorFuture representing that task.Synchronously submits a Runnable task with id for execution asynchronously.Synchronously submits a task with definedid
andtimeToLive
parameters for execution asynchronously.<T> RExecutorFuture<T>
Synchronously submits a value-returning task with specified id for execution asynchronously.<T> RExecutorFuture<T>
Synchronously submits a value-returning task with definedid
andtimeToLive
parameters for execution asynchronously.Synchronously submits tasks batch for execution asynchronously.<T> RExecutorFuture<T>
Synchronously submits a value-returning task for execution asynchronously and returns a Future representing the pending results of the task.<T> RExecutorFuture<T>
Synchronously submits a value-returning task with definedtimeToLive
parameter for execution asynchronously.submitAsync
(Runnable task) Submits task for execution asynchronouslysubmitAsync
(Runnable... tasks) Submits tasks batch for execution asynchronously.submitAsync
(Runnable task, long timeToLive, TimeUnit timeUnit) Submits a task with definedtimeToLive
parameter for execution asynchronously.submitAsync
(String id, Runnable task) Synchronously submits a Runnable task with id for execution asynchronously.submitAsync
(String id, Runnable task, Duration timeToLive) Synchronously submits a task with definedid
andtimeToLive
parameters for execution asynchronously.<T> RExecutorFuture<T>
submitAsync
(String id, Callable<T> task) Synchronously submits a value-returning task with specified id for execution asynchronously.<T> RExecutorFuture<T>
submitAsync
(String id, Callable<T> task, Duration timeToLive) Synchronously submits a value-returning task with definedid
andtimeToLive
parameters for execution asynchronously.submitAsync
(Callable<?>... tasks) Submits tasks batch for execution asynchronously.<T> RExecutorFuture<T>
submitAsync
(Callable<T> task) Submits task for execution asynchronously<T> RExecutorFuture<T>
submitAsync
(Callable<T> task, long timeToLive, TimeUnit timeUnit) Submits a value-returning task with definedtimeToLive
parameter for execution asynchronously.
-
Field Details
-
SHUTDOWN_STATE
public static final int SHUTDOWN_STATE- See Also:
-
TERMINATED_STATE
public static final int TERMINATED_STATE- See Also:
-
-
Constructor Details
-
RedissonExecutorService
public RedissonExecutorService(Codec codec, CommandAsyncExecutor commandExecutor, Redisson redisson, String name, QueueTransferService queueTransferService, ConcurrentMap<String, ResponseEntry> responses, ExecutorOptions options)
-
-
Method Details
-
getTaskCount
public int getTaskCount()Description copied from interface:RExecutorService
Returns amount of tasks awaiting execution or currently in execution.- Specified by:
getTaskCount
in interfaceRExecutorService
- Returns:
- amount of tasks
-
getTaskCountAsync
Description copied from interface:RExecutorServiceAsync
Returns amount of tasks awaiting execution or currently in execution.- Specified by:
getTaskCountAsync
in interfaceRExecutorServiceAsync
- Returns:
- amount of tasks
-
hasTask
Description copied from interface:RExecutorService
Returnstrue
if this Executor Service has task bytaskId
awaiting execution or currently in execution.- Specified by:
hasTask
in interfaceRExecutorService
- Parameters:
taskId
- id of task- Returns:
true
if this Executor Service has task
-
getTaskIds
Description copied from interface:RExecutorService
Returns list of task ids awaiting execution or currently in execution.- Specified by:
getTaskIds
in interfaceRExecutorService
- Returns:
- task ids
-
getTaskIdsAsync
Description copied from interface:RExecutorServiceAsync
Returns list of task ids awaiting execution or currently in execution.- Specified by:
getTaskIdsAsync
in interfaceRExecutorServiceAsync
- Returns:
- task ids
-
hasTaskAsync
Description copied from interface:RExecutorServiceAsync
Returnstrue
if this Executor Service has task bytaskId
awaiting execution or currently in execution- Specified by:
hasTaskAsync
in interfaceRExecutorServiceAsync
- 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 interfaceRExecutorService
- Returns:
- workers amount
-
registerWorkers
public void registerWorkers(int workers) - Specified by:
registerWorkers
in interfaceRExecutorService
-
registerWorkers
Description copied from interface:RExecutorService
Register workers- Specified by:
registerWorkers
in interfaceRExecutorService
- Parameters:
options
- - worker options
-
registerWorkers
- Specified by:
registerWorkers
in interfaceRExecutorService
-
execute
-
execute
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 interfaceRExecutorService
- Parameters:
tasks
- tasks to execute
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceExecutorService
-
getName
Description copied from interface:RExecutorService
Returns executor name- Specified by:
getName
in interfaceRExecutorService
- Returns:
- name of service
-
delete
public boolean delete()Description copied from interface:RExecutorService
Deletes executor request queue and state objects- Specified by:
delete
in interfaceRExecutorService
- Returns:
true
if any of objects were deleted
-
deleteAsync
Description copied from interface:RExecutorServiceAsync
Deletes executor request queue and state objects- Specified by:
deleteAsync
in interfaceRExecutorServiceAsync
- Returns:
true
if any of objects were deleted
-
shutdownNow
- Specified by:
shutdownNow
in interfaceExecutorService
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdown
in interfaceExecutorService
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminated
in interfaceExecutorService
-
awaitTermination
- Specified by:
awaitTermination
in interfaceExecutorService
- Throws:
InterruptedException
-
submit
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'sget
method will return the task's result upon successful completion.- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfaceRExecutorService
- 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
Description copied from interface:RExecutorService
Synchronously submits a value-returning task with definedtimeToLive
parameter for execution asynchronously. Returns a Future representing the pending results of the task. The Future'sget
method will return the task's result upon successful completion.- Specified by:
submit
in interfaceRExecutorService
- Type Parameters:
T
- the type of the task's result- Parameters:
task
- the task to submittimeToLive
- time to live intervaltimeUnit
- unit of time to live interval- Returns:
- a Future representing pending completion of the task
-
submitAsync
Description copied from interface:RExecutorServiceAsync
Submits a value-returning task with definedtimeToLive
parameter for execution asynchronously. Returns a Future representing the pending results of the task. The Future'sget
method will return the task's result upon successful completion.- Specified by:
submitAsync
in interfaceRExecutorServiceAsync
- Type Parameters:
T
- the type of the task's result- Parameters:
task
- the task to submittimeToLive
- time to live intervaltimeUnit
- unit of time to live interval- Returns:
- a Future representing pending completion of the task
-
submitAsync
Description copied from interface:RExecutorServiceAsync
Submits task for execution asynchronously- Specified by:
submitAsync
in interfaceRExecutorServiceAsync
- Type Parameters:
T
- type of return value- Parameters:
task
- task to execute- Returns:
- Future object
-
submit
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 interfaceRExecutorService
- Parameters:
tasks
- - tasks to execute- Returns:
- Future object
-
createTaskParameters
-
createTaskParameters
-
createTaskParameters
-
createTaskParameters
-
submitAsync
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 interfaceRExecutorServiceAsync
- Parameters:
tasks
- tasks to execute- Returns:
- Future object
-
submit
Description copied from interface:RExecutorService
Synchronously submits a Runnable task for execution asynchronously and returns a RExecutorFuture representing that task. The Future'sget
method will return the given result upon successful completion.- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfaceRExecutorService
- Type Parameters:
T
- the type of the result- Parameters:
task
- the task to submitresult
- the result to return- Returns:
- a Future representing pending completion of the task
-
submit
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 interfaceRExecutorService
- Parameters:
tasks
- - tasks to execute- Returns:
- Future object
-
submitAsync
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 interfaceRExecutorServiceAsync
- Parameters:
tasks
- tasks to execute- Returns:
- Future object
-
submit
Description copied from interface:RExecutorService
Synchronously submits a Runnable task for execution asynchronously. Returns a RExecutorFuture representing task completion. The Future'sget
method will returnnull
upon successful completion.- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfaceRExecutorService
- Parameters:
task
- the task to submit- Returns:
- a Future representing pending completion of the task
-
submit
Description copied from interface:RExecutorService
Synchronously submits a task with definedtimeToLive
parameter for execution asynchronously. Returns a Future representing task completion. The Future'sget
method will return the task's result upon successful completion.- Specified by:
submit
in interfaceRExecutorService
- Parameters:
task
- the task to submittimeToLive
- time to live intervaltimeUnit
- unit of time to live interval- Returns:
- a Future representing pending completion of the task
-
submitAsync
Description copied from interface:RExecutorServiceAsync
Submits a task with definedtimeToLive
parameter for execution asynchronously. Returns a Future representing task completion. The Future'sget
method will return the task's result upon successful completion.- Specified by:
submitAsync
in interfaceRExecutorServiceAsync
- Parameters:
task
- the task to submittimeToLive
- time to live intervaltimeUnit
- unit of time to live interval- Returns:
- a Future representing pending completion of the task
-
submitAsync
Description copied from interface:RExecutorServiceAsync
Submits task for execution asynchronously- Specified by:
submitAsync
in interfaceRExecutorServiceAsync
- Parameters:
task
- - task to execute- Returns:
- Future object
-
schedule
Description copied from interface:RScheduledExecutorService
Synchronously 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.- Specified by:
schedule
in interfaceRScheduledExecutorService
- Specified by:
schedule
in interfaceScheduledExecutorService
- Parameters:
task
- 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 returnnull
upon completion
-
scheduleAsync
Description copied from interface:RScheduledExecutorServiceAsync
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.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- 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
-
schedule
Description copied from interface:RScheduledExecutorService
Synchronously 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.- Specified by:
schedule
in interfaceRScheduledExecutorService
- Specified by:
schedule
in interfaceScheduledExecutorService
- 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:
- a ScheduledFuture that can be used to extract result or cancel
-
scheduleAsync
Description copied from interface:RScheduledExecutorServiceAsync
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.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- 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
-
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 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.- Specified by:
schedule
in interfaceRScheduledExecutorService
- Parameters:
command
- the task to executedelay
- the time from now to delay executionunit
- the time unit of the delay parameterttl
- time to live intervalttlUnit
- unit of time to live interval- Returns:
- a ScheduledFuture representing pending completion of
the task and whose
get()
method will returnnull
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 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.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- 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
-
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 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.- Specified by:
schedule
in interfaceRScheduledExecutorService
- 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
-
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 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.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- 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
-
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 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:
scheduleAtFixedRate
in interfaceRScheduledExecutorService
- Specified by:
scheduleAtFixedRate
in 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
-
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 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:
scheduleAtFixedRateAsync
in interfaceRScheduledExecutorServiceAsync
- 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
-
schedule
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 interfaceRScheduledExecutorService
- Parameters:
task
- the task to executecronSchedule
- cron schedule object- Returns:
- future object
-
scheduleAsync
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 interfaceRScheduledExecutorServiceAsync
- Parameters:
task
- the task to executecronSchedule
- 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 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.- Specified by:
scheduleWithFixedDelay
in interfaceRScheduledExecutorService
- Specified by:
scheduleWithFixedDelay
in 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
-
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 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.- Specified by:
scheduleWithFixedDelayAsync
in interfaceRScheduledExecutorServiceAsync
- 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
-
cancelTask
Description copied from interface:RExecutorService
Cancel task by id- Specified by:
cancelTask
in interfaceRExecutorService
- Parameters:
taskId
- id of task- Returns:
true
if task has been canceled successfully ornull
if task wasn't found- See Also:
-
cancelTaskAsync
Description copied from interface:RExecutorServiceAsync
Cancel task by id- Specified by:
cancelTaskAsync
in interfaceRExecutorServiceAsync
- Parameters:
taskId
- id of task- Returns:
true
if task has been canceled successfully ornull
if task wasn't found- See Also:
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - Specified by:
invokeAny
in interfaceExecutorService
- 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 interfaceExecutorService
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException - Specified by:
invokeAll
in interfaceExecutorService
- Throws:
InterruptedException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException - Specified by:
invokeAll
in interfaceExecutorService
- Throws:
InterruptedException
-
submit
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 interfaceRExecutorService
- Type Parameters:
T
- the type of the task's result- Parameters:
id
- task idtask
- the task to submit- Returns:
- a Future representing pending completion of the task
-
submitAsync
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 interfaceRExecutorServiceAsync
- Type Parameters:
T
- the type of the task's result- Parameters:
id
- task idtask
- the task to submit- Returns:
- a Future representing pending completion of the task
-
submit
Description copied from interface:RExecutorService
Synchronously submits a value-returning task with definedid
andtimeToLive
parameters for execution asynchronously. Returns a Future representing the pending results of the task.- Specified by:
submit
in interfaceRExecutorService
- Type Parameters:
T
- the type of the task's result- Parameters:
id
- task idtask
- the task to submittimeToLive
- time to live interval- Returns:
- a Future representing pending completion of the task
-
submitAsync
Description copied from interface:RExecutorServiceAsync
Synchronously submits a value-returning task with definedid
andtimeToLive
parameters for execution asynchronously. Returns a Future representing the pending results of the task.- Specified by:
submitAsync
in interfaceRExecutorServiceAsync
- Type Parameters:
T
- the type of the task's result- Parameters:
id
- task idtask
- the task to submittimeToLive
- time to live interval- Returns:
- a Future representing pending completion of the task
-
submit
Description copied from interface:RExecutorService
Synchronously submits a task with definedid
andtimeToLive
parameters for execution asynchronously. Returns a Future representing task completion.- Specified by:
submit
in interfaceRExecutorService
- Parameters:
id
- task idtask
- the task to submittimeToLive
- time to live interval- Returns:
- a Future representing pending completion of the task
-
submitAsync
Description copied from interface:RExecutorServiceAsync
Synchronously submits a task with definedid
andtimeToLive
parameters for execution asynchronously. Returns a Future representing task completion.- Specified by:
submitAsync
in interfaceRExecutorServiceAsync
- Parameters:
id
- task idtask
- the task to submittimeToLive
- time to live interval- Returns:
- a Future representing pending completion of the task
-
submit
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 interfaceRExecutorService
- Parameters:
id
- task idtask
- the task to submit- Returns:
- a Future representing pending completion of the task
-
submitAsync
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 interfaceRExecutorServiceAsync
- Parameters:
id
- task idtask
- the task to submit- Returns:
- a Future representing pending completion of the task
-
schedule
Description copied from interface:RScheduledExecutorService
Synchronously schedules a Runnable task with definedid
for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
schedule
in interfaceRScheduledExecutorService
- Parameters:
id
- task idcommand
- 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 returnnull
upon completion
-
scheduleAsync
Description copied from interface:RScheduledExecutorServiceAsync
Synchronously schedules a Runnable task with definedid
for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- 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 returnnull
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 definedid
andtimeToLive
parameters for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
schedule
in interfaceRScheduledExecutorService
- Parameters:
id
- task idcommand
- 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 returnnull
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 definedid
andtimeToLive
parameters for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- 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 returnnull
upon completion
-
schedule
Description copied from interface:RScheduledExecutorService
Synchronously schedules a value-returning task with definedid
for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
schedule
in interfaceRScheduledExecutorService
- 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
-
scheduleAsync
Description copied from interface:RScheduledExecutorServiceAsync
Synchronously schedules a value-returning task with definedid
for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- Type Parameters:
V
- the type of the callable's result- Parameters:
id
- task idtask
- the function to executedelay
- 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 definedid
andtimeToLive
parameters for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
schedule
in interfaceRScheduledExecutorService
- 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
-
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 definedid
andtimeToLive
parameters for execution asynchronously after the givendelay
. Returns a RScheduledFuture representing that task.- Specified by:
scheduleAsync
in interfaceRScheduledExecutorServiceAsync
- Type Parameters:
V
- the type of the callable's result- Parameters:
id
- task idtask
- 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
public RScheduledFuture<?> scheduleAtFixedRate(String id, Runnable command, Duration initialDelay, Duration period) Description copied from interface:RScheduledExecutorService
Synchronously schedules a Runnable task with definedid
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:
scheduleAtFixedRate
in interfaceRScheduledExecutorService
- Parameters:
id
- task idcommand
- 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
-
scheduleAtFixedRateAsync
public RScheduledFuture<?> scheduleAtFixedRateAsync(String id, Runnable task, Duration initialDelay, Duration period) Description copied from interface:RScheduledExecutorServiceAsync
Synchronously schedules a Runnable task with definedid
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:
scheduleAtFixedRateAsync
in interfaceRScheduledExecutorServiceAsync
- 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
public RScheduledFuture<?> scheduleWithFixedDelay(String id, Runnable command, Duration initialDelay, Duration delay) Description copied from interface:RScheduledExecutorService
Synchronously schedules a Runnable task with specifiedid
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.- Specified by:
scheduleWithFixedDelay
in interfaceRScheduledExecutorService
- Parameters:
id
- task idcommand
- 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
-
scheduleWithFixedDelayAsync
public RScheduledFuture<?> scheduleWithFixedDelayAsync(String id, Runnable task, Duration initialDelay, Duration delay) Description copied from interface:RScheduledExecutorServiceAsync
Synchronously schedules a Runnable task with specifiedid
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.- Specified by:
scheduleWithFixedDelayAsync
in interfaceRScheduledExecutorServiceAsync
- 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
Description copied from interface:RScheduledExecutorService
Synchronously schedules a Runnable task with definedid
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 interfaceRScheduledExecutorService
- Parameters:
id
- task idtask
- the task to executecronSchedule
- cron schedule object- Returns:
- future object
-
scheduleAsync
Description copied from interface:RScheduledExecutorServiceAsync
Synchronously schedules a Runnable task with definedid
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 interfaceRScheduledExecutorServiceAsync
- Parameters:
id
- task idtask
- the task to executecronSchedule
- cron schedule object- Returns:
- future object
-