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


subprocessor – The other event processor to add

add_subprocessors(*subprocessors: src.event_processor.event_processor.EventProcessor)

Add multiple subprocessors at once.


subprocessors – The tuple of subprocessors

add_subprocessors_in_package(package: module)

Add all the processors found in all modules of a package as subprocessors.

Note that you should specify an actual package, and not just the name of a package.


package – The package that should be searched for event processors

invoke(event: Dict)Any

Invoke the correct processor for an event.

There may be multiple processors invoked, depending on the invocation strategy.


event – The event to find a processor for


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.

  • event_filter – The filter for which to match events

  • rank – This processor’s rank (when there are multiple matches for a single event)


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.


Dependency Injection