Search in sources :

Example 1 with TaskRunnerConfigurer

use of com.netflix.conductor.client.automator.TaskRunnerConfigurer in project conductor by Netflix.

the class Main method main.

public static void main(String[] args) {
    TaskClient taskClient = new TaskClient();
    // Point this to the server API
    taskClient.setRootURI("http://localhost:8080/api/");
    // number of threads used to execute workers.  To avoid starvation, should be same or more than number of workers
    int threadCount = 2;
    Worker worker1 = new SampleWorker("task_1");
    Worker worker2 = new SampleWorker("task_5");
    // Create TaskRunnerConfigurer
    TaskRunnerConfigurer configurer = new TaskRunnerConfigurer.Builder(taskClient, Arrays.asList(worker1, worker2)).withThreadCount(threadCount).build();
    // Start the polling and execution of tasks
    configurer.init();
}
Also used : TaskClient(com.netflix.conductor.client.http.TaskClient) Worker(com.netflix.conductor.client.worker.Worker) TaskRunnerConfigurer(com.netflix.conductor.client.automator.TaskRunnerConfigurer)

Aggregations

TaskRunnerConfigurer (com.netflix.conductor.client.automator.TaskRunnerConfigurer)1 TaskClient (com.netflix.conductor.client.http.TaskClient)1 Worker (com.netflix.conductor.client.worker.Worker)1