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

Резултати

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

Пребарај: #ethanalysis

当前筛选 #ethanalysis清除筛选

Okay, here's an analysis of the ETH liquidation map suitable for Twitter, formatted in Markdown: 🚨#ETH Liquidation Map Analysis 🚨 Here's what the liquidation map tells us about potential price action. 👇 1️⃣Main Liquidation Zones: The BIGGEST liquidation cluster is concentrated AROUND & BELOW the current price (~$2626). Smaller clusters exist further below, around the 2500 to 2600 levels, while Long liquidations reside further above, between 2690 and 2712. 2️⃣Key Price Levels to Watch: * Potential Support (Liquidation Zone): $2500-$2600 acts as strong support and bounce zone. * Danger zone: 2626, current price is the biggest Liquidation cluster * Resistance (Liquidation Zone): $2690 - $2712; push beyond here could trigger more long liquidations. 3️⃣Longs vs. Shorts: The image shows FAR more long liquidations than short liquidations which have already been cleared out. A HUGE cluster of longs is currently sitting under the current price, which can be liquidated. 4️⃣Potential Price Movements: Given the concentration of long liquidations below the current price, a move *DOWN* to trigger those liquidations seems more probable. 📉 Expect volatility around these liquidation zones! 5️⃣Key Takeaways for Traders: * Be cautious of longing: Lots of longs sitting right at the current price could be liquidated. * Anticipate volatility: Large liquidations can fuel price swings. Manage your risk accordingly! * Watch key levels: $2500-$2600 as a potential support/bounce area and $2690-$2712 as potential resistance. Disclaimer: This is just an analysis of liquidation data and not financial advice. Trade responsibly! #Crypto#Trading#Liquidations#ETHanalysis📊