public class WorkflowTaskCoordinator
extends java.lang.Object
| Constructor and Description |
|---|
WorkflowTaskCoordinator(com.netflix.discovery.EurekaClient ec,
TaskClient client,
int threadCount,
java.lang.Iterable<Worker> taskWorkers) |
WorkflowTaskCoordinator(com.netflix.discovery.EurekaClient ec,
TaskClient client,
int threadCount,
Worker... taskWorkers) |
| Modifier and Type | Method and Description |
|---|---|
void |
init()
Starts the polling
|
void |
registerWorker(Worker worker) |
WorkflowTaskCoordinator |
withPollInterval(int pollInterval) |
WorkflowTaskCoordinator |
withSleepWhenRetry(int sleepWhenRetry) |
WorkflowTaskCoordinator |
withUpdateRetryCount(int updateRetryCount) |
WorkflowTaskCoordinator |
withWorkerQueueSize(int workerQueueSize) |
public WorkflowTaskCoordinator(com.netflix.discovery.EurekaClient ec,
TaskClient client,
int threadCount,
Worker... taskWorkers)
ec - Eureka client - used to identify if the server is in discovery or not. When the server goes out of discovery, the polling is terminated. If passed null, discovery check is not done.client - Task client used to communicate to conductor server.threadCount - # of threads assigned to the workers. Should be at-least the size of taskWorkers to avoid starvation in a busy system.taskWorkers - workers that will be used for polling work and task execution.
Please see init() method. The method must be called after this constructor for the polling to start.public WorkflowTaskCoordinator(com.netflix.discovery.EurekaClient ec,
TaskClient client,
int threadCount,
java.lang.Iterable<Worker> taskWorkers)
ec - Eureka client - used to identify if the server is in discovery or not. When the server goes out of discovery, the polling is terminated. If passed null, discovery check is not done.client - TaskClient used to communicate to the conductor serverthreadCount - # of threads assigned to the workers. Should be at-least the size of taskWorkers to avoid starvation in a busy system.taskWorkers - workers that will be used for polling work and task execution.
Please see init() method. The method must be called after this constructor for the polling to start.public WorkflowTaskCoordinator withPollInterval(int pollInterval)
pollInterval - polling interval in millisecond.public WorkflowTaskCoordinator withSleepWhenRetry(int sleepWhenRetry)
sleepWhenRetry - time in millisecond, for which the thread should sleep when task update call fails, before retrying the operation.public WorkflowTaskCoordinator withUpdateRetryCount(int updateRetryCount)
updateRetryCount - # of attempts to be made when updating task status when update status call fails.withSleepWhenRetry(int)public WorkflowTaskCoordinator withWorkerQueueSize(int workerQueueSize)
workerQueueSize - Worker queue size.public void init()