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

Резултати

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

Пребарај: #op

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

@CoinSonar · Post #244058 · 18.04.2026 г., 08:02

#OP | Volume spike (USDT PAIR) 64 times the average volume 126.26K USDT traded in 1 min └Selling vol: 113.20K USDT 🔴 Boost score: 1/10 24h Vol: 2.82M USDT (Binance) Price: 0.1336 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243884 · 18.04.2026 г., 00:02

#OP | Volume spike (USDT PAIR) 65 times the average volume 127.49K USDT traded in 1 min └Buying vol: 111.92K USDT 🟢 Boost score: 8/10 24h Vol: 2.82M USDT (Binance) Price: 0.1349 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243763 · 17.04.2026 г., 16:02

#OP | Volume spike (USDT PAIR) 71 times the average volume 139.46K USDT traded in 1 min └Selling vol: 115.82K USDT 🔴 Boost score: 1/10 24h Vol: 2.82M USDT (Binance) Price: 0.1333 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243690 · 17.04.2026 г., 13:37

#OP | Volume spike (USDT PAIR) 9 times the average volume 286.83K USDT traded in 15 min └Selling vol: 170.17K USDT 🔴 Boost score: 1/10 24h Vol: 2.82M USDT (Binance) Price: 0.1343 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243286 · 16.04.2026 г., 19:15

#OP | Volume spike (USDT PAIR) 59 times the average volume 117.20K USDT traded in 1 min └Buying vol: 100.25K USDT 🟢 Boost score: 7/10 24h Vol: 2.82M USDT (Binance) Price: 0.1318 (-2.5% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28111 · 03.11.2024 г., 05:16

#OP/USDT analysis : #OP is currently forming a continuation pattern within a downtrend. The price has broken previous lows, and it is anticipated that it will continue its bearish momentum. It is advisable to wait for a pullback to the identified zone for a short entry, as the previous swing low is expected to be tested. TF : 1D Entry : $1.493 Target : $1.076 SL : $1.773

Hashtags

Pro Analysis

@proanalysistrader · Post #27879 · 27.08.2024 г., 09:31

#OP/USDT analysis : #OP has broken out above the 200 EMA and the previous resistance zone with strong bullish momentum. It is now retesting the breakout zone. The price is expected to continue its bullish bias and test previous highs. Wait for a break of the $1.517 level to go long. TF : 2H Entry : $1.517 Target : $1.643 SL : $1.444

Hashtags

American Crypto©

@americancryptotrading · Post #27519 · 30.01.2026 г., 10:33

🇺🇸#OP/USDT is consolidating near the lowerborder of the descendingchannel formation on the 3D chart🔍 Bullish if we bounce off the one🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27466 · 11.12.2025 г., 09:18

🇺🇸#OP/USDT has found support at the lowerborder of the descendingchannel on the 3D chart🔍 Expecting a bounce soon🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27336 · 08.08.2025 г., 09:02

🇺🇸#OP/USDT is ready to break out of the descendingresistance on the daily timeframe💁‍♂️ Looking for a leg upward✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27236 · 02.05.2025 г., 10:01

🇺🇸#OP/USDT is printing the descendingresistance line on the daily chart🧐 Breakout will bring a huge rally🐃 American Crypto©

Hashtags

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