MCPcopy
hub / github.com/mitmproxy/mitmproxy / trigger_event

Method trigger_event

mitmproxy/addonmanager.py:285–294  ·  view source on GitHub ↗

Asynchronously trigger an event across all addons.

(self, event: hooks.Hook)

Source from the content-addressed store, hash-verified

283 func(*event.args())
284
285 async def trigger_event(self, event: hooks.Hook):
286 """
287 Asynchronously trigger an event across all addons.
288 """
289 for i in self.chain:
290 try:
291 with safecall():
292 await self.invoke_addon(i, event)
293 except exceptions.AddonHalt:
294 return
295
296 def trigger(self, event: hooks.Hook):
297 """

Callers 5

test_async_haltFunction · 0.95
handle_lifecycleMethod · 0.95
test_mixed_async_syncFunction · 0.80
runningMethod · 0.80
doneMethod · 0.80

Calls 2

invoke_addonMethod · 0.95
safecallFunction · 0.85

Tested by 2

test_async_haltFunction · 0.76
test_mixed_async_syncFunction · 0.64