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

Резултати

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

Пребарај: #nmr

当前筛选 #nmr清除筛选
Coin Sonar

@CoinSonar · Post #244171 · 18.04.2026 г., 12:26

#NMR | Volume spike (USDT PAIR) 317 times the average volume 98.25K USDT traded in 1 min └Selling vol: 61.49K USDT 🔴 Boost score: 1/10 24h Vol: 445.92K USDT (Binance) Price: 8.75 (-1.3% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243656 · 17.04.2026 г., 13:09

#NMR | Volume spike (USDT PAIR) 28 times the average volume 130.67K USDT traded in 15 min └Selling vol: 79.47K USDT 🔴 Boost score: 1/10 24h Vol: 445.92K USDT (Binance) Price: 8.86 (-1.3% in 24h)

Hashtags

American Crypto©

@americancryptotrading · Post #27188 · 18.03.2025 г., 12:27

🇺🇸#NMR/USDT has crossed through the descendingresistance on the daily timeframe🔍 Climbing higher from here🐃 American Crypto©

Hashtags

Alphavave Traders ️️️

@alphavave · Post #3048 · 25.12.2025 г., 02:00

#NMR is crushing it with a 1,925% profit! 💰💵 That's a 1️⃣9️⃣🔤 return on your money from just one signal😉💵 Not going to lie, we have pretty much cracked the crypto code here. The results speak for themselves. Bet you are wondering how... Too bad most won't ever figure it out💯 you want the Same, this is your last chance🎁 ⚡️Don't miss the Christmas Sale!⚡️ ✅Monthly access is now just $30 (originally $200) ✅6-Month access is now just $75 (originally $500) ✅Lifetime access is now just $188 💵 (originally $1250) Let’s make this your most profitable Christmas yet! 🎉 DM me now! 👉@Kevindexter✅

Hashtags

CRYPTO SIGNALS FREE

@crypto_vip_signals_free · Post #372 · 13.08.2021 г., 05:06

#NMR is a type of hedge fund built by a network of data scientists fundamentally it is a strong project which haven’t pumped much in this altseason and definitely having potential to become a top gainer on binance. Technically NMR is on horizontal support and having bullish OBV divergence on 4H timeframe stochastic RSI looking bullish on 1D so now is the right time to build your position in it before breakout for massive profit😊 Target : 0.001-0.0011-0.00125-0.0015 For premium contatct @cryptomathh

Hashtags

12
ПретходнаСтраница 1 од 2Следна