Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
⚠️🇺🇸NEXT GENERATION GOP COULD BE MORE EXTREME THAN MAGA — WASHINGTON POST
🔹 Young white nationalists like Nick Fuentes infiltrating mainstream Republican circles 📱
🔹 Groypers movement gaining influence: antisemitic, nativist, racist ideology spreading 🚩
🔹 Iran war could be breaking point that expands their power within the party 🌍
🔹 Pattern repeats: Tea Party was more extreme than Gingrich era, now this generation tops MAGA 📈
🔹 Even Marjorie Taylor Greene broke with Trump over Iran threats as "madness" ⚡
One GOP insider warns: "Trump opened the door for this next generation to take over." The party's rightward spiral shows no signs of stopping! 😬🔥
#Republican#MAGA
@america
October 12, 2021: Texas Governor, San Diego crash, U.S. Navy, Indigenous Peoples' Day, Afghanistan
October 12, 2021: Texas Governor, San Diego crash, U.S. Navy, Indigenous Peoples' Day, Afghanistan
1. Republican Texas Governor Greg Abbott, responding to what he called "bullying" by the Biden Administration, barred all COVID-19 vaccine mandates in the state by any entity, including private employers.
2. A small aircraft crashed blocks from a high school campus near San Diego, killing at least two people and injuring two others, while also destroying homes, officials and local media said.
3. Former U.S. Navy nuclear engineer and his wife are scheduled to face their first court hearing on charges they attempted to sell secrets about nuclear submarines to a foreign power in exchange for cryptocurrency.
4. Christopher Columbus Day drew crowds with U.S. city parades marking the explorer's voyage and Italian-American culture, as the focus increasingly turned to the heritage and plight of indigenous people subjugated by European settlers.
5. Afghanistan's foreign minister appealed to the world for good relations but avoided making firm commitments on girls' education despite international demands to allow all Afghan children to go back to school.
#TexasGovernor
#GregAbbot
#Republican
#Covid19
#Biden
#SanDiego
#Aircraftcrash
#UnitedStates
#Navy
#Cryptocurrency
#ChristopherColumbusDay
#Parades
#Afghanistan
#News
#Reuters
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖