Package org.redisson.api
Interface RExecutorServiceAsync
-
- All Known Subinterfaces:
RExecutorService,RScheduledExecutorService,RScheduledExecutorServiceAsync
- All Known Implementing Classes:
RedissonExecutorService
public interface RExecutorServiceAsyncDistributed async implementation ofExecutorService- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RFuture<Boolean>cancelTaskAsync(String taskId)Cancel task by idRFuture<Boolean>deleteAsync()Deletes executor request queue and state objectsRFuture<Integer>getTaskCountAsync()Returns amount of tasks awaiting for execution and/or currently in execution.RFuture<Set<String>>getTaskIdsAsync()Returns list of task ids awaiting for execution and/or currently in execution.RFuture<Boolean>hasTaskAsync(String taskId)Returnstrueif this Executor Service has task bytaskIdawaiting for execution and/or currently in executionRExecutorFuture<?>submitAsync(Runnable task)Submits task for execution asynchronouslyRExecutorBatchFuturesubmitAsync(Runnable... tasks)Submits tasks batch for execution asynchronously.RExecutorFuture<?>submitAsync(Runnable task, long timeToLive, TimeUnit timeUnit)Submits a task with definedtimeToLiveparameter for execution asynchronously.RExecutorBatchFuturesubmitAsync(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 definedtimeToLiveparameter for execution asynchronously.
-
-
-
Method Detail
-
hasTaskAsync
RFuture<Boolean> hasTaskAsync(String taskId)
Returnstrueif this Executor Service has task bytaskIdawaiting for execution and/or currently in execution- Parameters:
taskId- - id of task- Returns:
trueif this Executor Service has task
-
getTaskCountAsync
RFuture<Integer> getTaskCountAsync()
Returns amount of tasks awaiting for execution and/or currently in execution.- Returns:
- amount of tasks
-
getTaskIdsAsync
RFuture<Set<String>> getTaskIdsAsync()
Returns list of task ids awaiting for execution and/or currently in execution.- Returns:
- task ids
-
cancelTaskAsync
RFuture<Boolean> cancelTaskAsync(String taskId)
Cancel task by id- Parameters:
taskId- - id of task- Returns:
trueif task has been canceled successfully- See Also:
RExecutorFuture.getTaskId()
-
deleteAsync
RFuture<Boolean> deleteAsync()
Deletes executor request queue and state objects- Returns:
trueif any of objects were deleted
-
submitAsync
<T> RExecutorFuture<T> submitAsync(Callable<T> task)
Submits task for execution asynchronously- Type Parameters:
T- type of return value- Parameters:
task- - task to execute- Returns:
- Future object
-
submitAsync
<T> RExecutorFuture<T> submitAsync(Callable<T> task, long timeToLive, TimeUnit timeUnit)
Submits a value-returning task with definedtimeToLiveparameter for execution asynchronously. Returns a Future representing the pending results of the task. The Future'sgetmethod 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
RExecutorBatchFuture submitAsync(Callable<?>... tasks)
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
RExecutorFuture<?> submitAsync(Runnable task)
Submits task for execution asynchronously- Parameters:
task- - task to execute- Returns:
- Future object
-
submitAsync
RExecutorFuture<?> submitAsync(Runnable task, long timeToLive, TimeUnit timeUnit)
Submits a task with definedtimeToLiveparameter for execution asynchronously. Returns a Future representing task completion. The Future'sgetmethod 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
RExecutorBatchFuture submitAsync(Runnable... tasks)
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
-
-