Source code for bobocep.cep.engine.forwarder.pubsub

# Copyright (c) 2019-2024 r3w0p
# The following code can be redistributed and/or
# modified under the terms of the MIT License.

"""
Forwarder publish-subscribe classes.
"""

from abc import ABC, abstractmethod

from bobocep.cep.event import BoboEventAction


[docs] class BoboForwarderSubscriber(ABC): """ A forwarder subscriber interface. """
[docs] @abstractmethod def on_forwarder_update(self, event: BoboEventAction) -> None: """ :param event: Action event generated by Forwarder. """
[docs] class BoboForwarderPublisher(ABC): """ A forwarder publisher interface. """
[docs] @abstractmethod def subscribe(self, subscriber: BoboForwarderSubscriber): """ :param subscriber: Subscriber to add to list. """