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

Резултати

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

Пребарај: #cfx

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

@CoinSonar · Post #244125 · 18.04.2026 г., 10:29

#CFX | Volume spike (USDT PAIR) 163 times the average volume 140.93K USDT traded in 1 min └Selling vol: 124.54K USDT 🔴 Boost score: 1/10 24h Vol: 1.24M USDT (Binance) Price: 0.0614 (-4.8% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243760 · 17.04.2026 г., 15:52

#CFX | Volume spike (USDT PAIR) 10 times the average volume 138.01K USDT traded in 15 min └Selling vol: 76.35K USDT 🔴 Boost score: 1/10 24h Vol: 1.24M USDT (Binance) Price: 0.0632 (-4.8% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243591 · 17.04.2026 г., 10:35

#CFX | Volume spike (USDT PAIR) 11 times the average volume 145.26K USDT traded in 15 min └Selling vol: 120.85K USDT 🔴 Boost score: 1/10 24h Vol: 1.24M USDT (Binance) Price: 0.0636 (-4.8% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243542 · 17.04.2026 г., 08:30

#CFX | Volume spike (USDT PAIR) 11 times the average volume 144.26K USDT traded in 15 min └Buying vol: 75.43K USDT 🟢 Boost score: 3/10 24h Vol: 1.24M USDT (Binance) Price: 0.0649 (-4.8% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243443 · 17.04.2026 г., 04:32

#CFX | Volume spike (USDT PAIR) 10 times the average volume 131.45K USDT traded in 15 min └Selling vol: 88.66K USDT 🔴 Boost score: 1/10 24h Vol: 1.24M USDT (Binance) Price: 0.0667 (-4.8% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243370 · 17.04.2026 г., 00:11

#CFX | Volume spike (USDT PAIR) 9 times the average volume 129.11K USDT traded in 15 min └Selling vol: 89.35K USDT 🔴 Boost score: 1/10 24h Vol: 1.24M USDT (Binance) Price: 0.0668 (-4.8% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243335 · 16.04.2026 г., 21:50

#CFX | Volume spike (USDT PAIR) 9 times the average volume 128.41K USDT traded in 15 min └Selling vol: 70.09K USDT 🔴 Boost score: 1/10 24h Vol: 1.24M USDT (Binance) Price: 0.0647 (-4.8% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #27966 · 27.09.2024 г., 16:19

#CFX/USDT analysis : #CFX is presently trading within a resistance zone from where the price is expected to reject and exhibit a bearish move. The price is currently in an impulsive phase, with a corrective pullback pending and expected to form from the current zone. TF : 1h Entry : $0.1852 Target : $0.1566 SL : $0.1982

Hashtags

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