public interface RExecutorService extends ExecutorService, RExecutorServiceAsync
ExecutorService
Modifier and Type | Field and Description |
---|---|
static String |
MAPREDUCE_NAME
MapReduce's executor name
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancelTask(String taskId)
Cancel task by id
|
int |
countActiveWorkers()
Returns active workers amount available for tasks execution.
|
boolean |
delete()
Deletes executor request queue and state objects
|
void |
execute(Runnable... tasks)
Submits tasks batch for execution synchronously.
|
String |
getName()
Returns executor name
|
int |
getTaskCount()
Returns amount of tasks awaiting for execution and/or currently in execution.
|
Set<String> |
getTaskIds()
Returns list of task ids awaiting for execution and/or currently in execution.
|
boolean |
hasTask(String taskId)
Returns
true if this Executor Service has task
by taskId awaiting for execution and/or currently in execution |
void |
registerWorkers(int workers)
Deprecated.
|
void |
registerWorkers(int workers,
ExecutorService executor)
Deprecated.
|
void |
registerWorkers(WorkerOptions options)
Register workers
|
RExecutorBatchFuture |
submit(Callable<?>... tasks)
Synchronously submits tasks batch for execution asynchronously.
|
<T> RExecutorFuture<T> |
submit(Callable<T> task)
Synchronously submits a value-returning task for execution asynchronously and returns a
Future representing the pending results of the task.
|
<T> RExecutorFuture<T> |
submit(Callable<T> task,
long timeToLive,
TimeUnit timeUnit)
Synchronously submits a value-returning task with defined
timeToLive parameter
for execution asynchronously. |
RExecutorBatchFuture |
submit(Runnable... tasks)
Synchronously submits tasks batch for execution asynchronously.
|
RExecutorFuture<?> |
submit(Runnable task)
Synchronously submits a Runnable task for execution asynchronously.
|
RExecutorFuture<?> |
submit(Runnable task,
long timeToLive,
TimeUnit timeUnit)
Synchronously submits a task with defined
timeToLive parameter
for execution asynchronously. |
<T> RExecutorFuture<T> |
submit(Runnable task,
T result)
Synchronously submits a Runnable task for execution asynchronously
and returns a RExecutorFuture representing that task.
|
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow
cancelTaskAsync, deleteAsync, getTaskCountAsync, getTaskIdsAsync, hasTaskAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync
static final String MAPREDUCE_NAME
<T> RExecutorFuture<T> submit(Callable<T> task)
get
method will return the task's result upon
successful completion.submit
in interface ExecutorService
T
- the type of the task's resulttask
- the task to submit<T> RExecutorFuture<T> submit(Callable<T> task, long timeToLive, TimeUnit timeUnit)
timeToLive
parameter
for execution asynchronously. Returns a Future representing the pending
results of the task. The Future's get
method will return the
task's result upon successful completion.T
- the type of the task's resulttask
- the task to submittimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervalRExecutorBatchFuture submit(Callable<?>... tasks)
tasks
- - tasks to execute<T> RExecutorFuture<T> submit(Runnable task, T result)
get
method will
return the given result upon successful completion.submit
in interface ExecutorService
T
- the type of the resulttask
- the task to submitresult
- the result to returnRExecutorFuture<?> submit(Runnable task)
get
method will
return null
upon successful completion.submit
in interface ExecutorService
task
- the task to submitRExecutorFuture<?> submit(Runnable task, long timeToLive, TimeUnit timeUnit)
timeToLive
parameter
for execution asynchronously. Returns a Future representing task completion.
The Future's get
method will return the
task's result upon successful completion.task
- the task to submittimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervalRExecutorBatchFuture submit(Runnable... tasks)
tasks
- - tasks to executeString getName()
boolean delete()
true
if any of objects were deleted@Deprecated void registerWorkers(int workers)
@Deprecated void registerWorkers(int workers, ExecutorService executor)
void registerWorkers(WorkerOptions options)
options
- - worker optionsint getTaskCount()
int countActiveWorkers()
boolean hasTask(String taskId)
true
if this Executor Service has task
by taskId
awaiting for execution and/or currently in executiontaskId
- - id of tasktrue
if this Executor Service has taskSet<String> getTaskIds()
boolean cancelTask(String taskId)
taskId
- - id of tasktrue
if task has been canceled successfullyRExecutorFuture.getTaskId()
void execute(Runnable... tasks)
tasks
- - tasks to executeCopyright © 2014–2020 Redisson. All rights reserved.