Reuse a managed loop for multiple top-level async calls.
Section: Getting Started
Use asyncio.Runner for multiple async calls
python
python
import asyncio
async def ping(name):
await asyncio.sleep(0.1)
return f"pong:{name}"
with asyncio.Runner() as runner:
print(runner.run(ping("a")))
print(runner.run(ping("b")))Explanation
Useful when you need to call multiple async entrypoints in one synchronous process.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Getting Started
Run an async entrypoint
Execute a top-level coroutine and manage the event loop automatically.
Get the running loop and monotonic time
Use the loop clock for scheduling and deadlines.