Interface JobWorkerBuilderStep1.JobWorkerBuilderStep2
- All Known Implementing Classes:
JobWorkerBuilderImpl
- Enclosing interface:
- JobWorkerBuilderStep1
public static interface JobWorkerBuilderStep1.JobWorkerBuilderStep2
-
Method Summary
Modifier and TypeMethodDescriptionhandler
(JobHandler handler) Set the handler to process the jobs.
-
Method Details
-
handler
Set the handler to process the jobs. At the end of the processing, the handler should complete the job or mark it as failed;Example JobHandler implementation:
public final class PaymentHandler implements JobHandler { @Override public void handle(JobClient client, JobEvent jobEvent) { String json = jobEvent.getVariables(); // modify variables client .newCompleteCommand(jobEvent.getKey()) .variables(json) .send(); } };
The handler must be thread-safe.- Parameters:
handler
- the handle to process the jobs- Returns:
- the builder for this worker
-