TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

Пронајдени 3 слични објави

Пребарај: #functionality

当前筛选 #functionality清除筛选
BAGEVM 广播站

@bagenotice · Post #128 · 04.06.2025 г., 11:09

#功能通知 很高兴的通知大家,目前我们已经上线了新的自动续费的功能,已关闭传统的余额自动扣除方案,这样只有开启了自动续费按钮的机器才会自动扣除余额进行续费,其他机器将不会在出现忘记取消扣除余额的动作,欢迎大家进行体验反馈BUG。 #Functionality Notice We are very happy to inform you that we have launched a new automatic renewal function and have closed the traditional automatic balance deduction plan. In this way, only machines with the automatic renewal button turned on will automatically deduct the balance for renewal. Other machines will not forget to cancel the balance deduction action. Everyone is welcome to experience and feedback BUGs.

BAGEVM 广播站

@bagenotice · Post #119 · 14.04.2025 г., 10:33

#功能通知 很高兴的通知大家,目前我们已经上线了流量自动重置的功能,在流量重置页面你可以点击针对单个实例,设置在流量使用完毕后在账号余额充足的情况下,系统会自动帮您扣除余额重置流量 https://www.bagevm.com/index.php?m=trafficreset #Functionality Notice We are pleased to inform you that we have now launched the traffic automatic reset function, in the traffic reset page you can click on a single instance, set in the traffic after the use of sufficient account balance, the system will automatically help you deduct the balance to reset the traffic https://www.bagevm.com/index.php?m= trafficreset

BLC Market - mini-app BulCoin

@bulcoin_blc · Post #287 · 09.03.2026 г., 11:30

How task creation will work in BLC Market We continue to showcase the interface of the future BLC Market app. Today - one of the key elements of the platform: task creation. A user will be able to post a task in just a few steps: • choose a category • describe the task • add photo or video - if needed • set the price, choosing the coin for payment • publish the task After publication, the task becomes available to performers who can offer their services. All transactions will take place within the platform using BLC. In the following posts, we will show: • what the performer's profile will look like • how arbitration will occur through the Association of Arbitration Courts • how the transaction system works Early access to the interface testing is given to Pioneers participants. #Tasks#BLC_Market#functionality FAQ | BUY