Три способа выполнить множество задач с asyncio
Функция для примера:
async def do_it(n):
await asyncio.sleep(random.uniform(0.5, 1))
return n
1. Последовательный вызов
async def main():
for i in range(100):
result = await do_it(i)
Такой вызов имеет смысл только тогда, когда результат одной задачи требуется для вызова следующей.
Если они независимы, то это антипаттерн, так как аналогичен простому синхронному вызову по очереди.
2. Упорядоченный результат
async def main():
tasks = [do_it(i) for i in range(100)]
results = await asyncio.gather(*tasks)
Выполняет корутины конкурентно и возвращает результат в виде списка.
Полезен когда требуется получить результаты в том же порядке в котором задачи отправлены.
3. Результат по мере готовности
tasks = [asyncio.create_task(do_it(i)) for i in range(100)]
for cor in asyncio.as_completed(tasks):
result = await cor
Так же выполняет корутины конкурентно, но не гарантирует порядок. Результат возвращается по мере готовности, каждый отдельно.
Полезен когда нужно обработать любой ответ как можно скорее.
#async
Evolution X - Official | Android 16 | Nothing Phone (2)
📝 Details:
- Version: v11.4.2
- Device: #Pong
- Released: 08/01/26
⬇️ Download: ROM
📖 Changelogs: Here
🆘 Support: Discord | Telegram
🏷 Tags: #AOSP#ROM#EvoX#Official
✍️Notes:
- Use latest NOS 3 firmware! Not 4.0
- Use OrangeFox recovery to install if sideloading!
- Gapps is included, do not flash again
- Dolby is included
🏆Credits:
- Ghost and Chandu for DT
- Fabian & Ghost & HELLBOY for Glyph
- HELLBOY for Meteoric Kernel
👤 Maintainer: @Superuser1958
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
Evolution X - Official | Android 16 | Nothing Phone (2)
📝 Details:
- Version: v11.2
- Device: #Pong
- Released: 23/09/25
⬇️ Downloads: ROM | Recovery Image
⚙️ Flashing Instructions: Here
📖 Changelogs: Here
🆘 Support: Here
🏷 Tags: #AOSP#ROM#EvoX#Official
✍️Notes:
- Gapps is included, do not flash again
- Use latest NOS 3 firmware
- Dolby is included
🏆Credits:
- Ghost and Chandu for DT
- Fabian & HELLBOY for Glyph
- HELLBOY for Meteoric Kernel
👤 Maintainer: @Superuser1958
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
Evolution X - Official | Android 15 | Nothing Phone (2)
📝 Details:
- Version: v10.7
- Device: #Pong
- Released: 09/06/25
⬇️ Downloads: ROM | Recovery Image
⚙️ Flashing Instructions: Here
📖 Changelog: Here
🆘 Support: Here
🏷 Tags: #AOSP#ROM#QPR2#EvoX#Official
✍️Notes:
- Gapps is included, do not flash again!
- Use latest NOS 3 firmware
- Dolby is included
- Clean Flash is required from 10.3 or lower
🏆Credits:
- Chandu for base DT
- Ghost for Dolby and additional fixes
- Fabian & HELLBOY for Glyph
- HELLBOY for Meteoric Kernel
👤 Maintainer: @Superuser1958
🐙 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
Evolution X - Official | Android 15 | Nothing Phone (2)
📝 Details:
- Version: v10.6
- Device: #Pong
- Released: 14/05/25
⬇️ Downloads: ROM | Recovery Image
⚙️ Flashing Instructions: Here
📖 Changelogs: Here
🆘 Support: Here
🏷 Tags: #AOSP#ROM#QPR2#EvoX#Official
✍️Notes:
- Gapps is included, do not flash again!
- Use latest NOS 3 firmware
- Dolby is included
- Clean Flash is required for this update
🏆Credits:
- Chandu for base DT
- Ghost for Dolby and additional fixes
- Fabian & HELLBOY for Glyph
- HELLBOY for Meteoric Kernel
👤 Maintainer: @Superuser1958
🐙 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
Evolution X - Official | Android 16 | Nothing Phone (2)
📝 Details:
- Version: v11.5.2
- Device: #Pong
- Released: 03/02/26
⬇️ Download: Gapps | Vanilla
🛟 Recovery: Here
📖 Changelogs: Here
🆘 Support: Discord | Telegram
🏷 Tags: #AOSP#ROM#EvoX#Official#QPR1
✍️Notes:
- Firmware is included! (NOS 4.0)
- Sideloading/USB in recovery works as intended now
- Gapps is included, do not flash again
- Dolby is included
🏆Credits:
- Ghost and Chandu for DT
- Fabian & Ghost & HELLBOY for Glyph
- HELLBOY for Kernel base
👤 Maintainer: @Superuser1958
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
Evolution X - Official | Android 15 | Nothing Phone (2)
📝 Details:
- Version: v10.3
- Device: #Pong
- Released: 22/02/25
⬇️ Downloads: ROM | Recovery Image
⚙️ Flashing Instructions: Here
📖 Changelogs: Here
🆘 Support: Here
🏷 Tags: #AOSP#ROM#QPR1#EvoX#Official
✍️Notes:
- Gapps is included, do not flash again!
- Firmware is included
- Dolby is included
🏆Credits:
- Chandu for base DT
- Ghost for Dolby and additional fixes
- Fabian & HELLBOY for Glyph
- HELLBOY for Meteoric Kernel
👤 Maintainer: @Superuser1958
🐙 Chat @NothingPhone2
🔔 Updates @NothingPhone2Updates