MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / get_global_loop

Function get_global_loop

apps/application/flow/tools.py:355–370  ·  view source on GitHub ↗

获取全局共享的事件循环

()

Source from the content-addressed store, hash-verified

353
354
355def get_global_loop():
356 """获取全局共享的事件循环"""
357 global _global_loop, _loop_thread
358
359 with _loop_lock:
360 if _global_loop is None:
361 _global_loop = asyncio.new_event_loop()
362
363 def run_forever():
364 asyncio.set_event_loop(_global_loop)
365 _global_loop.run_forever()
366
367 _loop_thread = threading.Thread(target=run_forever, daemon=True, name="GlobalAsyncLoop")
368 _loop_thread.start()
369
370 return _global_loop
371
372
373def _extract_tool_id(raw_id):

Callers 1

mcp_response_generatorFunction · 0.85

Calls 1

startMethod · 0.45

Tested by

no test coverage detected