- class quart.signals.AsyncNamedSignal(name: str, doc: Optional[str] = None)#
- connect(receiver: Callable, *args: Any, **kwargs: Any) Callable #
Connect receiver to signal events sent by sender.
receiver – A callable. Will be invoked by
send()with sender= as a single positional argument and any **kwargs that were provided to a call to
sender – Any object or
ANY, defaults to
ANY. Restricts notifications delivered to receiver to only those
send()emissions sent by sender. If
ANY, the receiver will always be notified. A receiver may be connected to multiple sender values on the same Signal through multiple calls to
weak – If true, the Signal will hold a weakref to receiver and automatically disconnect when receiver goes out of scope or is garbage collected. Defaults to True.
- async send(*sender: Any, **kwargs: Any) List[Tuple[Callable, Any]] #
Emit this signal on behalf of sender, passing on **kwargs.
Returns a list of 2-tuples, pairing receivers with their return value. The ordering of receiver notification is undefined.
*sender – Any object or
None. If omitted, synonymous with
None. Only accepts one positional argument.
**kwargs – Data to be sent to receivers.
- class quart.signals.AsyncNamespace#
- signal(name: str, doc: Optional[str] = None) AsyncNamedSignal #
NamedSignalname, creating it if required.
Repeated calls to this function will return the same signal object.