public interface Worker
Modifier and Type | Method and Description |
---|---|
static Worker |
create(java.lang.String taskType,
java.util.function.Function<com.netflix.conductor.common.metadata.tasks.Task,com.netflix.conductor.common.metadata.tasks.TaskResult> executor) |
com.netflix.conductor.common.metadata.tasks.TaskResult |
execute(com.netflix.conductor.common.metadata.tasks.Task task)
Executes a task and returns the updated task.
|
default java.lang.String |
getIdentity()
Override this method to app specific rules.
|
default int |
getLongPollTimeoutInMS()
The client will wait for at-least specified timeout in milliseconds for task queue to be "filled".
|
default int |
getPollCount()
Override this method to change the number of tasks to be polled.
|
default int |
getPollingInterval()
Override this method to change the interval between polls.
|
java.lang.String |
getTaskDefName()
Retrieve the name of the task definition the worker is currently working on.
|
default void |
onErrorUpdate(com.netflix.conductor.common.metadata.tasks.Task task)
Called when the task coordinator fails to update the task to the server.
|
default boolean |
paused()
Override this method to pause the worker from polling.
|
default boolean |
preAck(com.netflix.conductor.common.metadata.tasks.Task task)
Callback used by the WorkflowTaskCoordinator before a task is acke'ed.
|
java.lang.String getTaskDefName()
com.netflix.conductor.common.metadata.tasks.TaskResult execute(com.netflix.conductor.common.metadata.tasks.Task task)
task
- Task to be executed.TaskResult
object
If the task is not completed yet, return with the status as IN_PROGRESS.default boolean preAck(com.netflix.conductor.common.metadata.tasks.Task task)
task
- Task to be ack'ed before executiondefault void onErrorUpdate(com.netflix.conductor.common.metadata.tasks.Task task)
task
- Task which cannot be updated back to the server.default boolean paused()
default java.lang.String getIdentity()
default int getPollCount()
default int getPollingInterval()
default int getLongPollTimeoutInMS()
static Worker create(java.lang.String taskType, java.util.function.Function<com.netflix.conductor.common.metadata.tasks.Task,com.netflix.conductor.common.metadata.tasks.TaskResult> executor)