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

Резултати

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

Пребарај: #whaleactivity

当前筛选 #whaleactivity清除筛选
Crypto M - Crypto News

@CryptoM · Post #64852 · 10.04.2026 г., 04:23

🚀 ZEC Experiences Significant Price Surge Amid Whale Activity ZEC has seen a notable price increase since April 8, according to Hyperliquid data. The cryptocurrency accelerated from approximately $269, achieving a 43.1% rise over two days. As of today, the price peaked at $385 and is currently reported at $367.5, marking a 24-hour increase of 15.7%. According to BlockBeats On-chain Detection, during this surge, whales who shorted before April 8 have incurred significant losses. Among the whales opening new million-dollar positions today, most are following the upward trend, with only one address, 0x931, taking a contrary short position. This short position was opened with a 10x leverage, amounting to $3.44 million at an average price of $365.8, with a liquidation price of $411.5. Additionally, the address has set take-profit and stop-loss orders at $350 and $411, respectively. #ZEC#Cryptocurrency#PriceSurge#WhaleActivity#Blockchain#CryptoTrading#OnChainAnalysis#LeverageTrading

Crypto M - Crypto News

@CryptoM · Post #64913 · 10.04.2026 г., 09:17

🚀 XRP Whale Activity Increases as Token Trades Near $1.34 Two significant XRP whale groups have accumulated approximately 130 million XRP, with the token trading close to $1.34 and maintaining a relatively stable performance over the past 30 days. According to NS3.AI, data from Glassnode and Santiment indicates that short-term holders have decreased their exposure. Meanwhile, resistance is forming around the $1.38 mark in the current technical setup. #XRP#WhaleActivity#CryptoTrading#Blockchain#Cryptocurrency#TokenAnalysis#MarketTrends#Glassnode#Santiment#PriceResistance