MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / run

Function run

mitmproxy/script/concurrent.py:19–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18 async def _concurrent(*args):
19 def run():
20 if inspect.iscoroutinefunction(fn):
21 # Run the async function in a new event loop
22 loop = asyncio.new_event_loop()
23 try:
24 loop.run_until_complete(fn(*args))
25 finally:
26 loop.close()
27 else:
28 fn(*args)
29
30 await asyncio.get_running_loop().run_in_executor(None, run)
31

Callers

nothing calls this directly

Calls 3

fnClass · 0.85
new_event_loopMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected