| Constructor and Description |
|---|
TaskExecutorService(int workerCount,
long idleTaskDelayMillis,
ThreadFactory threadFactory)
Create a Task manager with a given number of threads to process the tasks.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(T task)
Add a new task.
|
T |
getTask(String taskId)
Returns the
Task implementation relevant to the task id. |
void |
remove(String id)
|
void |
setExceptionHandler(TaskExceptionHandler exceptionHandler)
Set the exception handler for the task processors.
|
void |
shutdown()
Stop processing tasks and shutdown the executor pool.
|
void |
start()
Start processing the tasks.
|
void |
stop()
Stop processing the tasks.
|
public TaskExecutorService(int workerCount,
long idleTaskDelayMillis,
ThreadFactory threadFactory)
workerCount - maximum number of threads spawned to process the tasks.idleTaskDelayMillis - delay set for processing a task with IDLE
Task.TaskHint.threadFactory - thread factory to be used for processing the tasks.public void add(T task)
This add Task request is processed asynchronously.
task - Taskpublic T getTask(String taskId)
Task implementation relevant to the task id.taskId - id of the Task implementation.public void stop()
public void shutdown()
public void start()
public void setExceptionHandler(TaskExceptionHandler exceptionHandler)
exceptionHandler - TaskExceptionHandlerCopyright © 2017 WSO2. All rights reserved.