MCPcopy Create free account
hub / github.com/Louisym/MiniCC / cook_async

Function cook_async

tutorials/17_async_await_for_sse.py:63–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61 return f"{name} 完成"
62
63 async def cook_async():
64 # gather = 同时开始多个任务,等它们都完成
65 results = await asyncio.gather(
66 async_task("烧水", 0.3),
67 async_task("切菜", 0.2),
68 async_task("洗碗", 0.1),
69 )
70 return results
71
72 start = time.time()
73 results = asyncio.run(cook_async())

Callers 1

lesson_1_why_asyncFunction · 0.85

Calls 1

async_taskFunction · 0.85

Tested by

no test coverage detected