Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
Title : "The Mysterious Nightmare"
The nightmare I got a day before,
Was full of science and plenty more,
The world of progress that we think of tonight,
The robots were working, it was a dreadful night.
It was when the human were servants,
Robots were having bungalows or villas,
We were that time the only vagrants.
The humans were robots and the robots were humans,
They all were having parties and we were being summoned.
They were instructing us as if we were dolls,
But the reality was that it was they robotic dolls.
They were the ones we then pray to God,
The one who takes our ease and comfort and many more.
Suddenly, with a jerk of dream, I saw someone with spiritual rays,
I was unable to see the face but was feeling the sense of gaze.
The voice says," Oh my dear child, calm your mind and enjoy the note of nature".
I then opened my eyes to the end of this dreamy adventure.
In the morning dawn,
With the closet of bizarre dreams and an upset mind,
I woke up on the verge of a melancholic night.
Suddenly, I heard the crazy cries of birds,
It was so blissful that I can't express it within a few words.
Enjoying the subtlety of nature,
I realised the existence of each creature.
Praying to God I would never have such dream,
I started my routine work with an energising scream.
#review
#Cookie
#Nightmare
"Goodnight" and then I sleep. I spent the day with you and I plan on continuing so I keep you in my dreams. It feels magical. Almost surreal. This is what I've longed for. Even after you broke me, you never left my mind. Except this time you were a nightmare, not a dream
#review#nightmare#her#broken
Mi sono stancato di influencer e tiktoker vari, buoni solo a pietrificare l'attenzione verso cose futili.
#vaporonda#vaporwave#vapourwave#vaporart#seapunk#webpunk#glitch#glitchart#glitchartistscollective#chillwave#aesthetic#vaporwaveaesthetic#vaporwaveaesthetics#malinconia#melancholy#tristezza#sadness#sadboy#lofi#apparenza#appearance#appearance#illusione#illusion#incubo#nightmare