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

Пребарај: #tdcowen

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

@CryptoM · Post #65130 · 11.04.2026 г., 09:03

🚀 TD Cowen Analyst Lowers Target Price for MicroStrategy TD Cowen analyst Lance Vitanza has revised the target price for Bitcoin reserve company MicroStrategy (MSTR) from $440 to $350, while maintaining a buy rating. According to Odaily, this adjustment reflects the analyst's updated assessment of the company's financial outlook. #TDCowen#Analyst#TargetPrice#MicroStrategy#Bitcoin#MSTR#FinancialOutlook#BuyRating#BTC

Crypto M - Crypto News

@CryptoM · Post #64733 · 09.04.2026 г., 16:29

🚀 White House Stablecoin Report Unlikely to Ease Political Hurdles for Clarity Act The White House's recent report on stablecoins is not expected to alleviate political challenges surrounding the Clarity Act, according to TD Cowen. The report suggested that removing stablecoin yield could potentially increase bank lending by $2.1 billion. However, Jaret Seiberg noted that banks are likely to continue opposing cryptocurrency legislation unless it explicitly prohibits stablecoin yield. Seiberg also mentioned last week that there is only a one-in-three chance of the bill passing this year, according to NS3.AI. #WhiteHouse#Stablecoin#ClarityAct#Cryptocurrency#Banking#Legislation#PoliticalChallenges#Finance#TDcowen#NS3AI

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 #3946 · 22.01.2025 г., 04:00

Trump's Meme Coin Could Stifle Crypto Progress TD Cowen warns that Trump's TRUMP meme coin may complicate legislative efforts in the crypto market, potentially sparking investigations and increasing partisan tensions. Legislation is predicted to finalize by 2026. In related news, Trump acknowledged TRUMP's success, stating, "I don't know much about it other than I launched it." Recent transactions show $101 million #USDC transferred to Galaxy Digital and over $71 million minted by USDC Treasury. #Trump#Crypto#Legislation#USDC#GalaxyDigital#Altcoin#MemeCoin#Finance#Investigation#WhaleAlert#Tokenomics#DigitalAssets#Securities#MarketTrends#Blockchain#InvestorRelations#TDCowen#Funds#USD#Altman