Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
If an unprecedented drone attack on civilians in European waters can go unanswered, what message does that send to the world? Malta is not the only government being tested here. This is a moment of truth for the EU, for international law, and for all those who claim to uphold human rights. And so it is up to international community to demand accountability and end support for these crimes.
Sign our petition now. Tag UN experts, rapporteurs, and human rights bodies to demand a transparent investigation. Contact your government and demand they condemn this unprecedented attack. Support safe passage for our missions. Watch and share our content. And never forget to demand an end to Israel's illegal blockade, an end to the genocide, and to ensure self-determination for all Palestinian people.
SIGN NOW - https://bit.ly/alleyesondeck
#BreakTheSiege#FreePalestine#ConscienceShip#EndTheOccupation#HumanRights
Robert has long fought alongside Palestinians and isn't stopping now. Having spent time in Palestine documenting horrific human rights abuses by Israeli forces, he has seen the brutality of the occupation first hand. Despite the extreme difficulty in leaving his children and partner back home in what he describes as a "grieving process", he shares how important it is to use his privilege to be a part of the collective effort to break the siege on Gaza. As we have witnessed over the course of 9 months and 76+ years prior, we cannot fathom or predict the IOF's brutality or what they are capable of if they intercept 'Handala' in international waters. So we need your help in keeping Robert as safe as possible. We need your help in demanding safe passage for all volunteers onboard our Flotillas. Please share our videos, tag your politicians and ensure that we reach Gaza safely. #endtheblockade#breakthesiege#robertmartin#freepalestine#freegaza#endtheoccupation#solidarity#wewillsail#letthemsail
This Eid, our hearts are with the Palestinians of Gaza. You deserve life, justice, peace, and the right to celebrate Eid without mourning. One day soon, Eid will be celebrated in a Gaza that is whole, alive, and at peace. Until then, we will not stop. Eid Mubarak.
#EidMubarak#FreedomForGaza#Madleen#Solidarity#Palestine#EndTheOccupation#JusticeForGaza
UN experts warned months ago that Israel is deliberately starving Palestinians, and that famine is rapidly spreading across Gaza, and yet Israel continues with impunity and is sent billions of dollars by the US. Children, infants, pregnant women, people living with disabilities, the elderly and those with chronic illnesses are the most at risk of severe malnutrition, illness, and death. Mobilize today, and continue boycotting products and companies that support these war crimes. #freegaza#freepalestine#endtheoccupation#humanitarianaid#costofliving#northgaza#gazacity#freedomflotilla#ffc#breakthesiege#endtheblockade
#BDS
* prices are in US dollars
Our objectives—to break the blockade and raise awareness of the genocide against Palestinians in Gaza—remain unchanged. We will provide updates on our next departure when we are ready to sail again.
In the meantime, we urge you to join the #NoHarbourForGenocide campaign to take action against the siege on Gaza by opposing every country and company complicit in this genocide. #handala#ffc#freedomflotillacoalition#freegaza#freepalestine#endtheoccupation#breakthesiege#endtheblockade#iof#warcrimes#icc#icj
Despite relentless police brutality and state repression in Germany, Yasemin, a Kurdish-Turkish activist on the 'Handala' ship, remains unwavering in her fight for Palestinians. Born into resistance, she fearlessly confronts oppression, transforming each attempt to silence her into fuel to continue fighting for justice. Her steadfast belief in direct action and the power of collective resistance is undeterred by the dangers she has faced, which led her to join 'Handala'. Yasemin encourages all of us watching to disrupt capital and profits in order to create effective change. Download the No Thanks app, search every product before buying it, and boycott companies that support Zionism and Israel’s war crimes against Palestinians. We are never just one person. Together, it is possible to speak their language and hit them where it hurts - their wallets. #endtheoccupation#freegaza#freepalestine#endtheblockade#breakthesiege#freedomflotilla#ffc#yaseminacar#handala#berlin#bds#boycott#divest#sanction
This election is not just about what happens within U.S. borders—it’s about the lives of millions around the globe. When you vote, you’re making a statement about where America stands on human rights. History has shown us that you cannot negotiate with leaders who offer nothing but empty promises. Kamala Harris herself said, "Never let anyone tell you who you are. Show them who you are." Well, the Biden-Harris administration has shown us who they are. For ten months, they’ve done nothing but fund the annihilation of Gaza and the West Bank.
We cannot accept these empty words when hundreds of thousands of lives are at risk. It’s time to demand real action, not just lip service. Sign the petition to enact an arms embargo on Israel, spread the truth in your community, and mobilize for the sake of humanity.
Take Action Now:
🖋️ Sign the Petition: Not Another Bomb! Demand an arms embargo to stop the genocide (in our stories)
📰 Stay Informed: Join the Uncommitted Movement and tell Kamala Harris to stand on the right side of history. Sign up for updates.
🗣️ Spread the Word: Distribute flyers, educate your community, and support candidates who truly stand for human rights.
#KillerKamala#BidenHarris#USElections#DNC#ActForGaza#EndTheOccupation#NoMoreEmptyPromises#FreeGaza#FreePalestine#PermanentCeasefire#UNSecurityCouncil#GlobalImpact#FFC#FreedomFlotilla