Bases: object

Message multiplexer, to read messages from multiple asynchronous generators in parallel.

Instances of this class are async-iterable – for each incoming message, a tuple is produced: the physical message received by the plug, a source message if originating from within the system, and a primary flag to indicate supplementary messages created when a system-sourced message can’t be represented in a single plug message.


As per, only one iterator of this class should be used at once.


(.SentMessage, .Message, bool) tuple – Messages received and processed by any connected plug.


Connect plugs to the stream. When the stream is active, their methods will be called to start collecting queued messages.


plugs (.Plug list) – New plugs to merge in.


Disconnect plugs from the stream. Their tasks will be cancelled, and any last messages will be collected before removing.


plugs (.Plug list) – Active plugs to remove.