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

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #402 · 22 дек.

Отдельно разберём TaskGroup, который пришел на замену gather в Python 3.11. Ключевые отличия ▫️create_task() возвращает объект asyncio.Task, у которого есть соответствюущие методы управления. То есть у нас больше контроля ▫️это контекстный менеджер, который гарантирует что все таски будут остановлены по выходу из контекста ▫️ошибка автоматически отменяет незавершенные задачи, ▫️except* передает нам ExceptionGroup, в котором каждую ошибку можно обработать отдельно import asyncio import random async def do_it() -> str: if random.random() < 0.1: raise ValueError('Oops') delay = random.uniform(0.5, 1.5) await asyncio.sleep(delay) return delay async def main(): try: async with asyncio.TaskGroup() as tg: for _ in range(10): tasks.append(tg.create_task(do_it())) for t in tasks: print(t.result()) except *ValueError as e: for err in e.exceptions: print(err) asyncio.run(main()) Рекомендую изучить страницу Coroutines and Tasks из документации, где представлено больше интересных примеров и механизмов - таймауты - отмена задач - создание задач из другого потока #async

Hashtags

Резултати

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

Пребарај: #cryptoux

当前筛选 #cryptoux清除筛选

USDE by 👍XBANKING — A Next-Generation Decentralized Stablecoin XBANKING has launched USDE, a new stablecoin built specifically for DeFi, trading, and everyday payments. USDE blends stability, decentralization, and yield — offering 8% APR just for holding. Built on the 🤑 Solana blockchain. 💰USDE minting is now live ➡️app.xbanking.org 👍 1 USDE = 1 USD — always. It’s backed 1:1 by liquid assets — USDT and USDC, with real-time reserves exceeding 101%. 🔎Why hold USDE? ✔️ Earn 8% APR simply by holding — the yield is built into the token. ✔️ No need to chase DeFi protocols or calculate risks — USDE starts earning immediately. ✔️ Use it like any other stablecoin: trade, add to liquidity pools, lend, or borrow. ✔️ 100%+ backed by USDT and USDC — no liquidation risks like with collateralized stablecoins. ✔️ Runs on Solana — fast, cheap, and user-friendly. 😀How does it work? • Users deposit USDT or USDC into the XBANKING smart contract • In return, they receive USDE at a 1:1 ratio • The deposited stablecoins are allocated to DeFi strategies (liquidity pools, farming, etc.) • The yield is distributed among all USDE holders 💼What you can do with USDE ✔️ Hold to earn 8% APR ✔️ Swap to USDT or USDC with zero fees ✔️ Trade on DEXs (available on Raydium) ✔️ Provide liquidity ✔️ Lend and borrow 🛡 What makes USDE stand out? • Backed only by $USDT and $USDC • Reserves exceed 100% • 8% APR just for holding • Minting and burning are controlled via smart contracts • No liquidation mechanisms — unlike collateralized stablecoins • Includes a token freeze function as an additional safeguard against phishing or exploits 📌Where to use USDE — Mint: app.xbanking.org — Smart contract: 8dt9fQhoRKuWCSAsYweG2UMF3rbcG9xzNCTWXXSmdmEi — View on Solscan — DEX: Raydium USDE by XBANKING — a hybrid stablecoin designed for active DeFi use and long-term yield. #USDE#Xbanking#Stablecoin#DeFi#Solana#Raydium#CryptoUX