fire_hook
Function
This function is defined in the registry module.Emit a lifecycle event to every hook registered for it. The emitting counterpart to :func:
add_hook. Runtime components call this
at a real state transition (a kanban task created, a background job
finishing) so plugins subscribed to that :class:HookEvent actually hear
about it.
Best-effort by contract: an unknown event id, a malformed payload or a
raising subscriber is logged and swallowed — emitting an observability
event must never break the operation that produced it.
Signature
Parameters
Union[str, HookEvent]
required
HookEvent, its canonical value, or its member name.Optional[Dict]
Payload; recognised keys populate the event’s input dataclass and the remainder is carried through in
extra.Returns
List
The hook execution results, or
[] when there are no subscribers or
the emission was scheduled on a already-running event loop.Uses
resolve_hook_eventlogger.debugget_default_registryreg.get_hooksHookRunnerasyncio.get_running_looploop.is_runningloop.create_taskrunner.execute_PENDING_HOOK_TASKS.add
Source
View on GitHub
praisonaiagents/hooks/registry.py at line 548
