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

Резултати

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

Пребарај: #neo

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

@CoinSonar · Post #243560 · 17.04.2026 г., 09:03

#NEO | Volume spike (USDT PAIR) 216 times the average volume 96.00K USDT traded in 1 min └Buying vol: 82.65K USDT 🟢 Boost score: 8/10 24h Vol: 637.82K USDT (Binance) Price: 3.038 (-2.6% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28437 · 31.01.2025 г., 13:18

#NEO/USDT analysis : #NEO is currently in an uptrend, having retraced to test a previously respected support zone. The price is expected to rebound from this level and continue its upward movement to retest previous highs. TF : 1D Entry : $14.00 Target : $26.21 SL : $10.50

Hashtags

Pro Analysis

@proanalysistrader · Post #28330 · 09.12.2024 г., 09:56

#NEO/USDT analysis : #NEO is currently approaching support zone. Price is expected to rebound from this zone and resume its bullish momentum to test previous highs. TF : 2H Entry : $19.17 Target : $23.80 SL : $17.12

Hashtags

Pro Analysis

@proanalysistrader · Post #28123 · 05.11.2024 г., 14:38

#NEO/USDT analysis : #NEO is currently in a downtrend, forming lower lows (LLs) and lower highs (LHs) structure. The price has broken the trendline and is expected to rise higher during the correction phase, testing the previous swing high. TF : 1h Entry : $9.24 Target : $9.61 SL : $8.99

Hashtags

Pro Analysis

@proanalysistrader · Post #27919 · 09.09.2024 г., 17:44

#NEO/USDT analysis : #NEO is presently in a downtrend, trading below the 200 EMA. The price is anticipated to maintain its bearish momentum and revisit previous lows. To contemplate initiating a short position, it is recommended to wait for a retracement and a retest of the established resistance level. TF : 4h Entry : $24.05 Target : $9.73 SL : $10.03

Hashtags

American Crypto©

@americancryptotrading · Post #27291 · 25.06.2025 г., 09:35

🇺🇸#NEO/USDT is shaping descendingtriangle pattern on the daily chart👀 A breakout is on the way🚀 American Crypto©

Hashtags

123•••910
ПретходнаСтраница 1 од 10Следна