Handler#

class capymoa.ocl.events.Handler[source]#

Bases: ABC

Abstract interface for components that consume events.

A sink encapsulates subscription logic and can attach itself to an Dispatcher.

Subclass Handler and implement attach_with() to register the sink’s handlers with a source.

abstract attach_with(
dispatcher: Dispatcher,
) → Handler[source]#

Attach this sink to an event source.

Implementations should call capymoa.ocl.events.Dispatcher.subscribe() for each event type the sink needs to handle.

Parameters:

dispatcher – The source this sink should subscribe to.