This section covers the methods and classes used for handing internal and external events. For more information see Dispatch
Base class for all signals
Connects a signal to a receiver function
- receiver – The callback function which will be connected to this signal
- sender – Specifies a particular sender to receive signals from. Used to limit the receiver function to signal from particular sender types
send a signal from the sender to all connected receivers
Abstract base class for all Channel implementations. Provides pure virtual methods for subclass implementations
Initiates the channel and start listening to events. This method should be called at the startup sequence of the app, or as soon as events should be listened to. Pushes
consume_eventsinto the event loop.
Publish an event to the channel, to be sent to all subscribers
- key – The name of the event
- data – The data to be passed with the event. The data must be such that it can be encoded to JSON
Subscribe to channel events.
- event – The name of the event to subscribe to. String based
- subscriber – A
Carriertype object which delivers the message to its target
Represents a channel for event pub/sub based on in-memory queue. uses
asyncio.Queueto manage events.