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

Резултати

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

Пребарај: #uma

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

@CoinSonar · Post #244234 · 18.04.2026 г., 15:08

#UMA | Volume spike (USDT PAIR) 70 times the average volume 128.37K USDT traded in 15 min └Buying vol: 81.65K USDT 🟢 Boost score: 5/10 24h Vol: 175.35K USDT (Binance) Price: 0.494 (-3.0% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #244165 · 18.04.2026 г., 12:11

#UMA | Volume spike (USDT PAIR) 72 times the average volume 132.18K USDT traded in 15 min └Buying vol: 67.88K USDT 🟢 Boost score: 5/10 24h Vol: 175.35K USDT (Binance) Price: 0.479 (-3.0% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243587 · 17.04.2026 г., 10:19

#UMA | Volume spike (USDT PAIR) 180 times the average volume 109.91K USDT traded in 5 min └Buying vol: 66.85K USDT 🟢 Boost score: 5/10 24h Vol: 175.35K USDT (Binance) Price: 0.475 (-3.0% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28470 · 15.02.2025 г., 07:59

#UMA/USDT analysis : #UMA is expected to retest the 200 EMA before continuing its bearish momentum. The price is anticipated to move upward and test the swing high level. TF : 4H Entry : $1.750 Target : $1.929 SL : $1.638

Hashtags

Pro Analysis

@proanalysistrader · Post #28043 · 20.10.2024 г., 11:06

#UMA/USDT analysis : #UMA has broken out of the trendline and has retested the previous swing high zone following the breakout. The price is now poised to move upward and test higher levels. TF : 4H Entry : $2.807 Target : $3.197 SL : $2.690

Hashtags

American Crypto©

@americancryptotrading · Post #27276 · 10.06.2025 г., 13:00

🇺🇸#UMA/USDT is approaching breakout off the ascending channel formation on the daily chart👨‍💻 Time to rally✈️ American Crypto©

Hashtags

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