ezmsg.qt.gate#
Gate unit for controlling message flow in processor graphs.
Classes
- class GateMessage(open)[source]#
Bases:
objectControl message for opening/closing a gate.
- Parameters:
open (bool)
- class MessageGate(*args, settings=None, **kwargs)[source]#
Bases:
UnitGate unit that passes or blocks messages based on control input.
When the gate is open, messages flow through. When closed, messages are dropped. Gate state is controlled via INPUT_GATE stream.
- Parameters:
settings (Settings | None)
- SETTINGS#
alias of
MessageGateSettings
- STATE#
alias of
MessageGateState
- INPUT = InputStream:unlocated[Any]()#
- OUTPUT = OutputStream:unlocated[Any](self.num_buffers=32, self.force_tcp=None, self.allow_local=None)#
- INPUT_GATE = InputStream:unlocated[GateMessage]()#
- async initialize()[source]#
Runs when the Unit is instantiated.
This is called from within the same process this unit will live in. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.
This method is where you should initialize your unit’s state and prepare for message processing.
- Return type:
- async on_gate(msg)[source]#
Handle gate control messages.
- Return type:
- Parameters:
msg (GateMessage)