happyly.listening.listener.BaseListener

class happyly.listening.listener.BaseListener(subscriber, handler, deserializer, serializer=<happyly.serialization.dummy.DummySerde object>, publisher=None)

Bases: happyly.listening.executor.Executor, typing.Generic

Listener is a form of Executor which is able to run pipeline by an event coming from a subscription.

Listener itself doesn’t know how to subscribe, it subscribes via a provided subscriber.

As any executor, implements managing of stages inside the pipeline (deserialization, handling, serialization, publishing) and contains callbacks between the stages which can be easily overridden.

As any executor, listener does not implement stages themselves, it takes internal implementation of stages from corresponding components: handler, deserializer, publisher.

It means that listener is universal and can work with any serialization/messaging technology depending on concrete components provided to listener’s constructor.

start_listening()

subscriber = None

Provides implementation of how to subscribe.

Type: ~S