Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
#Tourist
The Great Wall of China :
is a huge chain of defensive fortifications stretching across northern China, it is a symbol of China and one of the Seven Wonders of the new world, known for its enormous length exceeding 21 thousand kilometers, it was built over centuries, especially during the Ming dynasty, it features watchtowers and strategic corridors, it is a UNESCO World Heritage Site and an outstanding world tourist destination.
📝
Construction history:
the first construction work began more than 2000 years ago, during the spring and autumn reign and the Warring States, and it was significantly expanded and renovated by later dynasties, especially the Ming Dynasty (1369-1644).
#Nature
#Tourist
Socotra:
is a Yemeni archipelago belonging to the Hadramaut region consisting of six islands on the Indian Ocean off the coast of the Horn of Africa near the Gulf of Aden, located about 240 kilometers (150 Mi) east of the coast of Somalia and 380 kilometers (240 Mi) south of the Arabian Peninsula.
The island was classified as a World Heritage Site in 2008, and the New York Times ranked it as the most beautiful island in the world in 2010 due to the unique biodiversity and environmental importance of this island and its reflection on the world. In October of 2013, the Socotra archipelago governorate became an independent governorate from Hadramaut governorate.
#History
#Tourist
The Great Sphinx:
is a huge stone sculpture carved from limestone, embodying a mythical creature with a human head and the body of a lion in a reclining position.
Facing directly from West to East, the statue is located on the Giza plateau on the West Bank of the Nile in Giza, Egypt.
It is believed that the facial features of the statue belong to Pharaoh Khafre.
The original figure of the Sphinx was carved from the Adim Rock, later it was restored with limestone layers. The statue is 73 M (240 ft) long from claw to tail, 20 M (66 ft) high from the base to the top of the head, and 19 m (62 ft) wide at its hind feet