Package org.axonframework.eventhandling
Interface EventProcessingStrategy
- All Known Implementing Classes:
AsynchronousEventProcessingStrategy,DirectEventProcessingStrategy
public interface EventProcessingStrategy
Interface describing a strategy for the processing of a batch of events. This is used by the
SubscribingEventProcessor to handle events directly (in the same thread) or asynchronously.- Author:
- Rene de Waele
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(List<? extends EventMessage<?>> events, Consumer<List<? extends EventMessage<?>>> processor) Handle the given batch ofevents.
-
Method Details
-
handle
void handle(@Nonnull List<? extends EventMessage<?>> events, @Nonnull Consumer<List<? extends EventMessage<?>>> processor) Handle the given batch ofevents. Once the strategy decides it is opportune to process the events it should pass them back to the givenprocessor.Note that the strategy may call back to the processor more than once for a single invocation of this method. Also note that a batch of events passed back to the processor may be made up of events from different batches.
- Parameters:
events- Events to be processedprocessor- Callback method on the processor that carries out the actual processing of events
-