MCPcopy Create free account
hub / github.com/LMCache/LMBenchmark / wait_for_tasks

Method wait_for_tasks

mooncake/utils.py:60–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 assert cls._loop is not None, "Loop is not started"
59
60 async def wait_for_tasks():
61 current_task = asyncio.current_task(cls._loop)
62 tasks = [
63 task
64 for task in asyncio.all_tasks(cls._loop)
65 if not task.done() and task is not current_task
66 ]
67 cls._logger.info(f"Waiting for {len(tasks)} tasks to finish")
68 if tasks:
69 await asyncio.gather(*tasks)
70
71 # Schedule the wait_for_tasks coroutine to be executed in the loop
72 future = asyncio.run_coroutine_threadsafe(wait_for_tasks(), cls._loop)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected