Class EventProcessorTask
java.lang.Object
org.axonframework.eventhandling.async.EventProcessorTask
- All Implemented Interfaces:
Runnable
Scheduler that keeps track of (Event processing) tasks that need to be executed sequentially.
- Since:
- 1.0
- Author:
- Allard Buijze
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback that allows the SequenceManager to receive a notification when this scheduler finishes processing events. -
Constructor Summary
ConstructorsConstructorDescriptionEventProcessorTask(Executor executor, EventProcessorTask.ShutdownCallback shutDownCallback) Initialize a scheduler using the givenexecutor. -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()booleanscheduleEvents(List<? extends EventMessage<?>> events, Consumer<List<? extends EventMessage<?>>> processor) Schedules a batch of events for processing.
-
Constructor Details
-
EventProcessorTask
Initialize a scheduler using the givenexecutor. This scheduler uses an unbounded queue to schedule events.- Parameters:
executor- The executor service that will process the eventsshutDownCallback- The callback to notify when the scheduler finishes processing events
-
-
Method Details
-
scheduleEvents
public boolean scheduleEvents(List<? extends EventMessage<?>> events, Consumer<List<? extends EventMessage<?>>> processor) Schedules a batch of events for processing. Will schedule a new invoker task if none is currently active. If the current scheduler is in the process of being shut down, this method will return false. This method is thread safe.- Parameters:
events- the events to scheduleprocessor- the component that will do the actual processing of the events- Returns:
- true if the event was scheduled successfully, false if this scheduler is not available to process events
- Throws:
IllegalStateException- if the queue in this scheduler does not have the capacity to add this event
-
run
public void run()
-