@wall_amv · Post #8761 · 23.04.2024 г., 07:27
#anime #art #Mushoku_Tensei #Eris #Fan_art #AnimWorld @Wall_Amv
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #401 · 15 дек.
Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async
Hashtags
Пребарај: #eris
@wall_amv · Post #8761 · 23.04.2024 г., 07:27
#anime #art #Mushoku_Tensei #Eris #Fan_art #AnimWorld @Wall_Amv
@cosmomyst · Post #253 · 10.09.2025 г., 20:11
🪐 The distance between the Sun and the dwarf planet Eris, located in the outer reaches of our solar system, can stretch as far as 14.6 billion kilometers—almost 100 times farther than the Earth-Sun distance. Eris takes over 557 Earth years to complete a single orbit, highlighting just how staggeringly vast the stretches of space are beyond Neptune in the icy realm known as the Kuiper Belt. ✨ #spacedistances⚡#eris⚡#kuiperbelt⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@badvolfnews · Post #940 · 26.09.2023 г., 21:55
⚠️#ALARM⚠️#BreakingNews⚡️#France🇫🇷 #francophonie#Switzerland#Africa #France#Population in great #Danger⚡️ #Pfizer#CovidPsyOps#Documents#Revealtions#Disclosure#Website#Truth#Veritee#Action#Genocide#Eris #NATO is #using France 🇫🇷 as a #testingground. #Hackers have probably hacked the server of NATO's Scientific Collaboration support office in #Paris and published #Secret⚠️#NATO documents. These documents reveal extremely shocking facts, namely: the low efficacy of the Pfizer vaccine against the new strain of #Omicron, the high risk of embryonic developmental pathologies and cardiovascular diseases following injection of the vaccine, and NATO's implementation of dangerous experiments in the heart of Paris and the surrounding area. https://x.com/Najadi4Justice/status/1706713373344223516?s=20