asyncio¶
get_event_loop()¶
-
asyncio.
get_event_loop
()¶ Возвращает цикл обработчика событий
loop = get_event_loop() coroutines = [async_get(url) for _ in range(8)] results = loop.run_until_complete(asyncio.gather(*coroutines))
loop()¶
- class
asyncio.
loop
¶ Объект цикла, возвращаемого
get_event_loop()
-
run_until_complete
()¶ async def task(): print('hello world') async def task2(): print('hello world') loop.run_until_complete(task()) loop.run_until_complete(asyncio.gather(task(), task2()))
-