Interface TaskRequestHandler<T extends TaskRequest>
-
- Type Parameters:
T- A TaskRequest implementation that can have extra fields and methods to be used by theTaskRequestHandler.
public interface TaskRequestHandler<T extends TaskRequest>Classes implementing this interface will handle the actualTaskRequest.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidrun(T taskRequest)The actual task processing to perform.default TaskContexttaskContext()Gives access to the TaskContext for the current task in a thread-safe manner.
-
-
-
Method Detail
-
run
void run(T taskRequest) throws Exception
The actual task processing to perform.- Parameters:
taskRequest- theTaskRequestto be processed- Throws:
Exception- if an error occurs during the processing, Carrot will automatically retry the task.
-
taskContext
default TaskContext taskContext()
Gives access to the TaskContext for the current task in a thread-safe manner. It will be available only during therun(TaskRequest)method.- Returns:
- the
TaskContextfor the current Task
-
-