Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
🌍 Tropical peat swamp forests store massive amounts of carbon in deep, soggy soils. Some areas in Southeast Asia hold peat deposits over 10 meters thick, locking away centuries of trapped carbon. ✨
#rainforest⚡#carbon⚡#wetlands⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 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 Arctic tundra’s permafrost acts like a giant freezer, locking away twice as much carbon as all the world’s forests combined, making it a crucial regulator for Earth’s climate. ✨
#permafrost⚡#tundra⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The global carbon cycle constantly moves carbon between the air, land, water, and living things. This cycle helps regulate Earth’s climate by storing and releasing carbon dioxide. ✨
#carbon⚡#climate⚡#cycles⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Canada holds more than 30% of the world’s forests, making it the top country for natural forest area. These forests store massive amounts of carbon and water—critical global natural resources. ✨
#resources⚡#forests⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
Grand Power кобура скрытого ношения на быстросъёмных крепежах с мягким слоем Alcantara внутри.
Двойной подсумок
Кобура скрытого ношения с Alcantara, с дополнительным магазином.
➡️#grandpower
➡️#моноблок
➡️#carbon
НЕ ПРОДАЖА ОРУЖИЯ! ⚠️
Демонстрируется только для наглядности функционала.
По вопросам заказа связывайтесь с нами📱
ПОДПИСЫВАЙТЕСЬ ЧТО БЫ НЕ ТЕРЯТЬСЯ:
📱MAX
📱VK
@DP_KH
🌍 Some grassland soils are so fertile they can support crops for decades without added fertilizer. These deep, dark soils store huge amounts of carbon, helping stabilize the global climate. ✨
#grasslands⚡#soil⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Argentina’s Pampas are vast temperate grasslands that grow some of the world’s richest soils. These grasslands support massive cattle herds and store huge amounts of carbon underground. ✨
#grasslands⚡#pampas⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels