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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #425 · 20 апр.

Недавно делал быстрый прототип асинхронного приложения в котором требовалось вызывать много синхронного кода. Да, я знаю, что это не лучший дизайн, но нужно было быстрое решение на один процесс и без очередей. Поэтому я выполнял код в потоках. Выглядело это примерно так: from fastapi.concurrency import run_in_threadpool async def execute(data: DataRequest) -> DataResponse: try: result = await run_in_threadpool(sync_function, data) return DataResponse(data=result) except Exception as e: return DataResponse( error=str(e), success=False, ) В общем работает нормально. Для всех вызовов под капотом используется общий тредпул, всё работает предсказуемо. Но потребовалось изменить количество запускаемых в пуле потоков (по умолчанию создается 40 воркеров). Так как дело происходит с FastAPI, делается это через lifespan используя настройки anyio: import anyio @asynccontextmanager async def lifespan(app: FastAPI): limiter = anyio.to_thread.current_default_thread_limiter() limiter.total_tokens = 100 yield # если вдруг нужно вернуть обратно limiter.total_tokens = 40 Зачем менять количество воркеров? - уменьшить, если оперативки мало (один тред занимает ~8мб) - увеличить чтобы выдержать нагрузку Если есть предложения получше при тех же вводных - предлагайте😉 #async

Hashtags

Резултати

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

Пребарај: #babydoge

当前筛选 #babydoge清除筛选
Algebra DEX Engine

@cryptoalgebra · Post #2387 · 04.07.2025 г., 15:20

Haven’t spotlighted our first non-EVM DEX in a while 👀 🌱 TONCO — the first CLAMM on TON blockchain — is thriving: 🔁 135K swaps,💸 $801K fees 📈 $285M total vol, $8.2M TVL, 537 weekly traders 🔥 Highlights: – $FDUSD launch w/ farming – #BabyDoge: $600K vol, 335% APR – $STORM farm: 500% APR – $BLUM: 100%+ real yield – $TON / $USDT: 42.5% avg APR – highest on TON All powered by Algebra 💪 Dive in 👉tonco.io

Hashtags

TONlines – News

@tonlines · Post #7226 · 15.05.2025 г., 13:15

⚡️STON.fi Welcomes BabyDoge to Its Platform #BabyDoge#TON STON.fi has announced that on May 19, BabyDoge will be available for trading and liquidity provision on their platform. Launched in 2021, BabyDoge has grown into a robust multi-chain ecosystem featuring elements like BabyDogeSwap and an NFT Marketplace. This move further integrates BabyDoge into the TON ecosystem, appealing to crypto enthusiasts through its community-driven initiatives. Source: link @tonlines

​​#BSC szn is already literally dragging liquidity off the entire market rn 😂 And CZ is increasing the pull by soft shilling his dog Been comfy in $CAKE, $CAT, $BAKE, $CGPT, $ANDY, #BabyDoge while also anticipating CZ’s dog. Open to whatever else makes sense on the chain tho 👇🏽

TONlines – News

@tonlines · Post #7315 · 21.05.2025 г., 17:12

Trading Competition: Baby Doge Coin on xRocket #xRocket#BabyDoge xRocket News announces the listing of Baby Doge Coin on xRocket with a trading competition. Participants trading the $1MBABYDOGE/$TON pair can win a share of the $5,000 prize pool, with the competition running from May 21 to May 28. Baby Doge Coin, a popular meme token on Binance Smart Chain, is now integrated with xRocket’s SocialFi tools. Source: link @tonlines

TONlines – News

@tonlines · Post #7313 · 21.05.2025 г., 16:35

⚡️STON.fi Welcomes BabyDoge Token #BabyDoge#STONfi#TON STON.fi announces the addition of the popular meme token, BabyDoge, to its trading platform. BabyDoge, known for its robust ecosystem featuring BabyDogeSwap and an NFT Marketplace, offers exclusive farming opportunities for users with $10,000 in rewards. Source: link @tonlines