Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
Big news for Apple users! 🍏✨ Did you hear? Apple has finally allowed emulators on iOS, and Delta stands out as one of the best out there! 🎮 Have you given it a try yet? Share your thoughts below! #iOS#Emulators#Delta
🌍 The Mississippi River Delta’s vast freshwater wetlands act as a natural filter, removing pollutants and buffering storm surges. These shifting marshes shelter over 400 species of fish and wildlife. ✨
#wetlands⚡#delta⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Okavango Delta in southern Africa floods seasonally with rainwater from distant highlands, creating vast, ever-shifting freshwater wetlands that support hundreds of rare animal species. ✨
#wetlands⚡#delta⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Danube Delta in Eastern Europe contains over 30 distinct types of freshwater wetlands, making it one of the most biodiverse delta systems in the world outside the tropics. ✨
#wetlands⚡#delta⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Ethiopia’s Lake Tana is the source of the Blue Nile and is surrounded by freshwater wetlands that support dozens of bird species found nowhere else, making it a hotspot for endemic wildlife. ✨
#wetlands⚡#delta⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 River deltas like Vietnam’s Mekong and the Mississippi in the US form complex freshwater wetlands, creating twisting channels and islands that shelter rare fish, birds, and vital crops. ✨
#wetlands⚡#delta⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Wetlands in the Siberian taiga freeze solid each winter, yet come alive in spring to host millions of migrating birds. These seasonal deltas become some of the world’s richest breeding grounds. ✨
#wetlands⚡#delta⚡#migration⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The Okavango Delta in Botswana is one of the few major river deltas that forms entirely inland, creating a lush wetland oasis in the middle of the Kalahari Desert. ✨
#rivers⚡#wetlands⚡#delta⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The Sudd in South Sudan is the largest freshwater wetland in the Nile basin. During flood season, its floating reeds can form islands that drift for kilometers across the swamp’s surface. ✨
#wetlands⚡#delta⚡#Africa⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Some freshwater wetlands and deltas trap so much carbon in their soil that, hectare for hectare, they store more than most forests—making them powerful natural climate regulators. ✨
#wetlands⚡#delta⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Florida Everglades, a vast freshwater wetland, is the only place on Earth where alligators and crocodiles coexist in the wild, thanks to its unique mix of habitats and water conditions. ✨
#wetlands⚡#delta⚡#wildlife⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍