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 слични објави

Пребарај: #stx

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

@CoinSonar · Post #244139 · 18.04.2026 г., 11:11

#STX | Volume spike (USDT PAIR) 29 times the average volume 109.22K USDT traded in 5 min └Selling vol: 76.58K USDT 🔴 Boost score: 1/10 24h Vol: 1.08M USDT (Binance) Price: 0.2332 (-2.7% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243737 · 17.04.2026 г., 15:21

#STX | Volume spike (USDT PAIR) 219 times the average volume 164.27K USDT traded in 1 min └Buying vol: 115.95K USDT 🟢 Boost score: 6/10 24h Vol: 1.08M USDT (Binance) Price: 0.2469 (-2.7% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243627 · 17.04.2026 г., 12:00

#STX | Volume spike (USDT PAIR) 29 times the average volume 108.55K USDT traded in 5 min └Buying vol: 67.85K USDT 🟢 Boost score: 4/10 24h Vol: 1.08M USDT (Binance) Price: 0.2421 (-2.7% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243500 · 17.04.2026 г., 07:26

#STX | Volume spike (USDT PAIR) 11 times the average volume 129.25K USDT traded in 15 min └Buying vol: 80.72K USDT 🟢 Boost score: 4/10 24h Vol: 1.08M USDT (Binance) Price: 0.2412 (-2.7% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243302 · 16.04.2026 г., 20:02

#STX | Volume spike (USDT PAIR) 32 times the average volume 121.23K USDT traded in 5 min └Buying vol: 66.12K USDT 🟢 Boost score: 4/10 24h Vol: 1.08M USDT (Binance) Price: 0.2479 (-2.7% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28484 · 20.02.2025 г., 13:20

#STX/USDT Analysis : #STX has bounced back from a key support zone and is likely to move up towards the swing high levels. For a long entry, it's advisable to wait for a price retracement to get a better entry point. TF : 4H Entry : $0.910 Target : $1.010 SL : $0.842

Hashtags

Pro Analysis

@proanalysistrader · Post #28428 · 27.01.2025 г., 13:48

#STX/USDT analysis : #STX is currently in a downtrend, trading below the 200 EMA and consistently making new lows. The price has broken below the previous support zone and has formed a lower low. It is recommended to wait for a retest of this support zone for a potential short entry, as further price declines are anticipated, targeting lower levels. TF : 4h Entry : $1.347 Target : $1.056 SL : $1.536

Hashtags

Pro Analysis

@proanalysistrader · Post #27864 · 22.08.2024 г., 05:37

#STX/USDT analysis : #STX has formed a rejection candle over the support zone and bounced off from there, expected to continue its bullish momentum to test previous highs. TF : 1W Entry : $1.609 Target : $2.792 SL : $1.045

Hashtags

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