Package org.redisson.api
Interface RExecutorService
- All Superinterfaces:
Executor
,ExecutorService
,RExecutorServiceAsync
- All Known Subinterfaces:
RScheduledExecutorService
- All Known Implementing Classes:
RedissonExecutorService
Distributed implementation of
ExecutorService
- Author:
- Nikita Koksharov
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncancelTask
(String taskId) Cancel task by idint
Returns active workers amount available for tasks execution.boolean
delete()
Deletes executor request queue and state objectsvoid
Submits tasks batch for execution synchronously.getName()
Returns executor nameint
Returns amount of tasks 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.void
registerWorkers
(int workers) Deprecated.void
registerWorkers
(int workers, ExecutorService executor) Deprecated.void
registerWorkers
(WorkerOptions options) Register workersSynchronously 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.Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow
Methods inherited from interface org.redisson.api.RExecutorServiceAsync
cancelTaskAsync, deleteAsync, getTaskCountAsync, getTaskIdsAsync, hasTaskAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync
-
Field Details
-
MAPREDUCE_NAME
MapReduce's executor name- See Also:
-
-
Method Details
-
submit
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
- 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
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
-
submit
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.- 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
-
submit
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
-
submit
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.- Parameters:
tasks
- - tasks to execute- Returns:
- Future object
-
submit
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
- 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
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
- Parameters:
task
- the task to submit- Returns:
- a Future representing pending completion of the task
-
submit
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
-
submit
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.- 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
-
submit
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
-
submit
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.- Parameters:
tasks
- - tasks to execute- Returns:
- Future object
-
getName
String getName()Returns executor name- Returns:
- name of service
-
delete
boolean delete()Deletes executor request queue and state objects- Returns:
true
if any of objects were deleted
-
registerWorkers
Deprecated. -
registerWorkers
Deprecated. -
registerWorkers
Register workers- Parameters:
options
- - worker options
-
getTaskCount
int getTaskCount()Returns amount of tasks awaiting execution or currently in execution.- Returns:
- amount of tasks
-
countActiveWorkers
int countActiveWorkers()Returns active workers amount available for tasks execution.- Returns:
- workers amount
-
hasTask
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
-
getTaskIds
Returns list of task ids awaiting execution or currently in execution.- Returns:
- task ids
-
cancelTask
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:
-
execute
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.- Parameters:
tasks
- tasks to execute
-