Package org.redisson.api
Interface RExecutorServiceAsync
- All Known Subinterfaces:
RExecutorService
,RScheduledExecutorService
,RScheduledExecutorServiceAsync
- All Known Implementing Classes:
RedissonExecutorService
public interface RExecutorServiceAsync
Distributed async implementation of
ExecutorService
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptioncancelTaskAsync
(String taskId) Cancel task by idDeletes executor request queue and state objectsReturns amount of tasks awaiting execution or currently in execution.Returns list of task ids awaiting execution or currently in execution.hasTaskAsync
(String taskId) Returnstrue
if this Executor Service has task bytaskId
awaiting execution or currently in executionsubmitAsync
(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.
-
Method Details
-
hasTaskAsync
Returnstrue
if this Executor Service has task bytaskId
awaiting execution or currently in execution- Parameters:
taskId
- id of task- Returns:
true
if this Executor Service has task
-
getTaskCountAsync
Returns amount of tasks awaiting execution or currently in execution.- Returns:
- amount of tasks
-
getTaskIdsAsync
Returns list of task ids awaiting execution or currently in execution.- Returns:
- task ids
-
cancelTaskAsync
Cancel task by id- Parameters:
taskId
- id of task- Returns:
true
if task has been canceled successfully ornull
if task wasn't found- See Also:
-
deleteAsync
Deletes executor request queue and state objects- Returns:
true
if any of objects were deleted
-
submitAsync
Submits task for execution asynchronously- Type Parameters:
T
- type of return value- Parameters:
task
- task to execute- Returns:
- Future object
-
submitAsync
Synchronously submits a value-returning task with specified id for execution asynchronously. Returns a Future representing the pending results of the task.- 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
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.- 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
Synchronously submits a value-returning task with definedid
andtimeToLive
parameters for execution asynchronously. Returns a Future representing the pending results of the task.- 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
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.- Parameters:
tasks
- tasks to execute- Returns:
- Future object
-
submitAsync
Submits task for execution asynchronously- Parameters:
task
- - task to execute- Returns:
- Future object
-
submitAsync
Synchronously submits a Runnable task with id for execution asynchronously. Returns a RExecutorFuture representing task completion.- Parameters:
id
- task idtask
- the task to submit- Returns:
- a Future representing pending completion of the task
-
submitAsync
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.- 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
Synchronously submits a task with definedid
andtimeToLive
parameters for execution asynchronously. Returns a Future representing task completion.- Parameters:
id
- task idtask
- the task to submittimeToLive
- time to live interval- Returns:
- a Future representing pending completion of the task
-
submitAsync
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.- Parameters:
tasks
- tasks to execute- Returns:
- Future object
-