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

Резултати

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

Пребарај: #pricetarget

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

@CryptoM · Post #65264 · 12.04.2026 г., 12:12

🚀 XRP's Triangle Breakout Sets $2.59 Price Target, Analyst Says Crypto analyst Dark Defender has highlighted a potential price target of $2.59 for XRP following its weekly triangle breakout. According to NS3.AI, Dark Defender noted that the cryptocurrency could find support at key Fibonacci levels of $1.31 and $1.37, provided it maintains its position above the previous resistance. #XRP#TriangleBreakout#PriceTarget#Crypto#DarkDefender#Fibonacci#NS3AI#Cryptocurrency

Crypto M - Crypto News

@CryptoM · Post #65292 · 12.04.2026 г., 15:13

🚀 Amazon's AI Investment Could Boost Stock by Over 50%, Analyst Predicts BNP Paribas Exane analyst Nick Jones has set a price target of $320 for Amazon, suggesting a potential upside of more than 50% from its April 7 closing price of $213.77. According to NS3.AI, Jones believes that Amazon's planned $200 billion investment in artificial intelligence by the end of 2026 is justified by increasing demand, backlog growth, and the broader deployment of AI across Amazon's product offerings. #Amazon#AI#Stock#Investment#BNPParibas#PriceTarget#ArtificialIntelligence#NS3AI#MarketGrowth#AmazonStock

Crypto M - Crypto News

@CryptoM · Post #64777 · 09.04.2026 г., 22:14

🚀 TD Cowen Adjusts Price Targets for Strategy and Sharplink TD Cowen has revised its price target for Bitcoin treasury firm Strategy to $350. According to NS3.AI, the financial services company also initiated coverage on Ethereum treasury company Sharplink with a 'buy' rating and set a price target of $16. TD analysts expressed confidence that Sharplink's staking revenue would be sufficient to cover its operating costs, even if Ethereum's market performance remains subdued. #TDCowen#PriceTarget#Bitcoin#Strategy#Sharplink#Ethereum#StakingRevenue#FinancialServices#Cryptocurrency#InvestmentAnalysis#BTC#ETH

Venture Village Wall 🦄

@venturevillagewall · Post #3932 · 20.01.2025 г., 19:00

Bitcoin Surges to New All-Time High Bitcoin jumps past $109,000, breaking out of a descending triangle pattern. Analysts predict a bullish trend, targeting $130,000 to $175,000 soon. Michael Egorov extends veCRV lock to maximum duration. #Bitcoin#Crypto#VC#Trading#TechnicalAnalysis#veCRV#Egorov#Bullish#MarketUpdate#BTC#PriceSurge#EconomicForecast#Cryptocurrency#Blockchain#CryptoMarket#Investments#PriceTarget