MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / dispatch

Method dispatch

masfactory/utils/hook.py:20–22  ·  view source on GitHub ↗
(self, hook_key, *args, **kwargs)

Source from the content-addressed store, hash-verified

18 self._hooks[hook_key].append(func)
19
20 def dispatch(self, hook_key, *args, **kwargs):
21 for func in self._hooks[hook_key]:
22 func(*args, **kwargs)
23
24 def has(self, hook_key, func=None) -> bool:
25 """Check whether a hook key has any callbacks registered.

Callers 4

_run_onceMethod · 0.80
wrapperFunction · 0.80
send_messageMethod · 0.80
receive_messageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected