Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
#Sudan: Il Segretario di Stato Marco Rubio ha annunciato con un post su X che la branca sudanese di Fratellanza Musulmana è stata designata come "organizzazione terroristica estera" e "organizzazione terroristica particolarmente designata" dal Dipartimento di Stato americano, in quanto supportata ed addestrata dalle IRGC iraniane.
— 🇸🇩: Last week the UAE backed RSF militia kidnapped a girl from the Nahda neighbourhood of Nyala and forcibly detained her for five days.
During this time, the victim was subjected to the most horrific forms of torture and gang rape, before being thrown onto a public road in a critical physical and psychological state.
#Sudan
@NewsfromSudan
🇸🇩#Sudan: Two families (reportedly nine people) were killed after an artillery shell fired by the Rapid Support Forces (RSF) struck a residential neighborhood in the city of Dilling, South Kordofan State, yesterday.
On March 28th, a partial blockade was reported in the area due to renewed clashes between the Sudanese Armed Forces and the RSF. The army was reportedly successful in repelling an attempted RSF advance. The rebels are attempting to re-establish control in the Kordofan area after the army broke an almost two-year-long siege in early January.
(via @SudanTribune_EN on X)
🇸🇩#Sudan: Three aid workers were killed and four others were injured in a drone strike by the Rapid Support Forces (RSF) on an aid convoy in South Kordofan yesterday.
The convoy, which was carrying food and other supplies, was hit while passing through the Kartala area.
This would be the second strike on an aid convoy this month by the RSF.
(via Al Jazeera)
🇸🇩#Sudan: Sudanese Armed Forces have launched an offensive against Rapid Support Forces toward the Al-Rahad - Um Ruwaba axis in North Kordofan, capturing the Al-Uba area from RSF militants.
Meanwhile, several drone strikes against RSF positions were also reported in Zalingei, western Sudan.
(📹 via @Sudan_tweet on X)
🇸🇩#Sudan: Aerial footage shows a drone operated by the Sudanese Armed Forces (SAF) dropping an explosive payload next to two trucks carrying Rapid Support Forces (RSF) militants.
(via @war_noir)
🇸🇩#Sudan: Sudanese Armed Forces (SAF) have shot down three RSF kamikaze drones which were allegedly attempting to target civilian infrastructure in the city of Al-Ubayyid, North Kordofan State.
🇸🇩#Sudan: Intense clashes continue between the Sudanese Armed Forces (SAF) and remnants of the Rapid Support Forces (RSF). Footage shows SAF Special Mission Forces (SMF) charging toward remaining RSF militants on the outskirts of South Kordofan, following weeks of heavy fighting in Dilling, where the RSF was recently pushed out.
(📹 via @Sudanis0 on X)
🇸🇩#Sudan: The Sudanese Armed Forces have reportedly broken through RSF lines and lifted the siege on the city of Dilling in South Kordofan after nearly two and a half years of blockade.
The army says it reopened the Dilling road following intense clashes with RSF militants, claiming heavy losses were inflicted on the militia in both personnel and equipment.
The RSF group has maintained a siege on Dilling since January 2024.
(via @AfriMEOSINT & @Sudan_tweet on X)
🇸🇩#Sudan: Rapid Support Forces (RSF) have recently shot down a SAF (Sudanese Armed Forces) drone.
The drone was a Baykar Bayraktar TB2, which is supplied by Turkey.
(via @war_noir)
🇸🇩#Sudan: Videos show Rapid Support Forces (RSF) militants inside the Heglig oil fields and the SAF's 90th Brigade headquarters after taking full control of the area in West Kordofan, including the town and its oil infrastructure.
Before the Sudanese Armed Forces pulled out, an official report states that operators in the area had already shut down their facilities and evacuated personnel to Unity State in South Sudan.
Meanwhile, the oil field had been inactive since August, when a drone strike prompted authorities to suspend all work at the site.
(via Al Jazeera; 📹 via @AFRIMEOSINT on X)
🇸🇩#Sudan: Sudanese Armed Forces have shelled multiple Rapid Support Forces (RSF) positions across several axes in Kordofan.
Reports also indicate Sudanese drone strikes earlier today in Al-Fula and Geneina in West Kordofan. In the footage, a reconnaissance drone can be seen coming down near the soldiers.
(Via @Sudan_tweet on X)