asyncio
asyncio
import asyncio async def func(_id): while True: print(f'task{_id}') await asyncio.sleep(1) if __name__ == '__main__': async def main(n_workers): coros = [func(_id) for _id in range(n_workers)] await asyncio.gather(*coros) asyncio.run(main(10))
asyncio.txt · 마지막으로 수정됨: 2024/03/23 02:38 저자 127.0.0.1