API Documentation¶
Event Processor¶
- class src.event_processor.event_processor.EventProcessor(invocation_strategy: src.event_processor.invocation_strategies.InvocationStrategies = <InvocationStrategies.FIRST_MATCH: <class 'src.event_processor.invocation_strategies.FirstMatch'>>)¶
A self-contained event processor.
- add_subprocessor(subprocessor: src.event_processor.event_processor.EventProcessor)¶
Add a subprocessor to this event processor
- Parameters
subprocessor – The other event processor to add
- invoke(event: Dict) → Any¶
Invoke the correct processor for an event.
There may be multiple processors invoked, depending on the invocation strategy.
- Parameters
event – The event to find a processor for
- Returns
The return value of the processor
- processor(event_filter: src.event_processor.filters.Filter, rank: int = 0)¶
Register a new processor with the given filter and rank.
- Parameters
event_filter – The filter for which to match events
rank – This processor’s rank (when there are multiple matches for a single event)
Exceptions¶
Exceptions for event processor.
- exception DependencyError¶
Exceptions for failures while resolving dependencies.
- exception EventProcessorError¶
General exception for the event-processor library.
- exception FilterError¶
Exception for failures related to filters.
- exception InvocationError¶
Exception for failures in invocation.