Skip to content

quick python

Roberto Fronteddu edited this page May 18, 2026 · 18 revisions

Asyncio

Run multiple workers

import asyncio

async def worker(name):
    while True:
        print(f"{name} working")
        await asyncio.sleep(1)

async def main():
    await asyncio.gather(
        worker("A"),
        worker("B"),
        worker("C"),
    )

asyncio.run(main())

Clone this wiki locally