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

Резултати

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

Пребарај: #cryptoderivatives

当前筛选 #cryptoderivatives清除筛选
Crypto M - Crypto News

@CryptoM · Post #64629 · 09.04.2026 г., 12:04

🚀 Tokenized Perpetual Swaps Reach $30.7 Billion in Weekly Volume Tokenized perpetual swaps linked to traditional assets have seen significant growth, reaching a weekly volume of $30.7 billion by the end of March, according to NS3.AI. This figure represents 1.72% of the total crypto derivatives market. The surge was primarily driven by commodities, with total weekly volume across these contracts peaking at $54.5 billion during the metals rally in February. #TokenizedSwaps#PerpetualSwaps#CryptoDerivatives#Commodities#MetalsRally#CryptoTrading#NS3AI#WeeklyVolume#FinancialMarkets#DigitalAssets

Crypto M - Crypto News

@CryptoM · Post #64776 · 09.04.2026 г., 22:11

🚀 CFTC and DOJ Legal Actions Could Influence Future of Prediction Markets The Commodity Futures Trading Commission (CFTC) and the Department of Justice (DOJ) have initiated legal proceedings against the states of Arizona, Connecticut, and Illinois concerning their actions against CFTC-registered prediction markets. According to NS3.AI, a recent 2-1 ruling by the Third Circuit Court upheld an injunction preventing New Jersey from applying its gambling laws to Kalshi, a prediction market platform. The court determined that Kalshi's contracts related to sports events are classified as swaps under the Commodity Exchange Act, thereby falling under the exclusive jurisdiction of the CFTC. This legal dispute has the potential to significantly influence the regulatory framework for decentralized prediction markets and crypto-native derivatives across the United States. #CFTC#DOJ#PredictionMarkets#Kalshi#CommodityExchangeAct#Regulation#CryptoDerivatives#USLaw#LegalActions#DecentralizedFinance