MCPcopy
hub / github.com/ormar-orm/ormar / send

Method send

ormar/signals/signal.py:84–96  ·  view source on GitHub ↗

Notifies all receiver functions with given kwargs :param sender: model that sends the signal :type sender: type["Model"] :param kwargs: arguments passed to receivers :type kwargs: Any

(self, sender: type["Model"], **kwargs: Any)

Source from the content-addressed store, hash-verified

82 return True if receiver_func is not None else False
83
84 async def send(self, sender: type["Model"], **kwargs: Any) -> None:
85 """
86 Notifies all receiver functions with given kwargs
87 :param sender: model that sends the signal
88 :type sender: type["Model"]
89 :param kwargs: arguments passed to receivers
90 :type kwargs: Any
91 """
92 receivers = [
93 receiver_func(sender=sender, **kwargs)
94 for receiver_func in self._receivers.values()
95 ]
96 await asyncio.gather(*receivers)
97
98
99class SignalEmitter(dict):

Callers 5

test_custom_signalFunction · 0.80
bulk_updateMethod · 0.80
removeMethod · 0.80
addMethod · 0.80
_emit_signalMethod · 0.80

Calls 1

valuesMethod · 0.45

Tested by 1

test_custom_signalFunction · 0.64