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 слични објави

Пребарај: #trmlabs

当前筛选 #trmlabs清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #4282 · 02.03.2025 г., 01:00

Bitcoin: Panic Buying Amid Market Shakeup Panic reactions in the market are evident as Bitcoin fluctuates. Key developments in the TON ecosystem include: - TVM Ventures launching a $100M fund for TON growth 🔗 - Updates from TON Core for Dec 2024 - Jan 2025 🔗 - Steve Yun discusses DeFi’s future in Telegram on CNBC 🔗 - First mid-core web3 game launched on TON 🔗 - Support program for Mini Apps initiated 🔗 - Innovations from Notcoin team highlighted 🔗 - LayerZero’s new USDT bridge enhances TON’s cross-chain capabilities 🔗 - Key investments in DeFi and SocialFi detailed by TVM Ventures 🔗 - TON’s ecosystem expands beyond major project monopolies 🔗 - TRM Labs introduces a comprehensive blockchain analysis tool for TON 🔗 - The domain believers.ton is permanently lost 🔗 #Bitcoin#DeFi#TON#Crypto#Web3#Investment#LayerZero#Blockchain#MiniApps#PanicBuying#TVMVentures#Notcoin#TRMLabs

Crypto M - Crypto News

@CryptoM · Post #64673 · 09.04.2026 г., 13:26

🚀 Drift Faces $285 Million Exploit Due to Social Engineering Tactics Drift experienced a significant exploit amounting to $285 million, attributed to suspected North Korean operatives employing in-person social engineering against its contributors. According to NS3.AI, the group targeted contributors at several major industry conferences over a six-month period leading up to the exploit. TRM Labs identified this incident as the largest DeFi hack of 2026 to date and the second-largest exploit in Solana's history. The attacker reportedly utilized CarbonVote Token to secure collateral acceptance, increase withdrawal limits, and extract assets, including USDC. #Drift#exploit#socialengineering#NorthKorea#DeFi#Solana#CarbonVoteToken#TRMLabs#USDC#cybersecurity

Crypto M - Crypto News

@CryptoM · Post #65273 · 12.04.2026 г., 13:10

🚀 Iran Reopens Strait of Hormuz with Bitcoin Toll Amid Ceasefire Iran has reopened the Strait of Hormuz under a two-week ceasefire, requiring tankers to pay a $1-per-barrel toll in Bitcoin for passage. According to NS3.AI, Hamid Hosseini stated that the system now processes 10 to 15 vessels daily, a significant decrease from the 135 vessels before the conflict. TRM Labs reported that since mid-March, Iran's military has collected up to $2 million per ship in Bitcoin, Chinese yuan, and potentially USDT. #Iran#StraitOfHormuz#BitcoinToll#Ceasefire#Tankers#NS3AI#Hosseini#TRMLabs#Military#Crypto#USDT#ChineseYuan#Shipping#Blockchain#IranEconomy#BTC