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

Резултати

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

Пребарај: #bitcointrust

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

@CryptoM · Post #64886 · 10.04.2026 г., 07:04

🚀 BlackRock's Bitcoin Trust Sees Significant Inflows Amid Market Dynamics Investors directed $269.3 million into BlackRock’s iShares Bitcoin Trust on Thursday, marking its most successful day since early March, coinciding with the escalation of the US-Iran conflict. According to Cointelegraph, this influx helped reverse two days of net outflows among the 12 U.S. spot Bitcoin ETFs, culminating in a net inflow of $358.1 million. Bitcoin ETF inflows serve as a measure of both retail and institutional interest in Bitcoin. The Fidelity Wise Origin Bitcoin Fund (FBTC) followed with $53.3 million in inflows, while the newly launched Morgan Stanley Bitcoin Trust (MSBT) contributed $14.9 million on its second trading day, as reported by Farside Investors. Bitwise and ARK 21Shares' Bitcoin ETFs saw inflows of $11.7 million and $4.8 million, respectively, while Franklin Templeton and VanEck’s Bitcoin products recorded around $2 million. Since March 23, BlackRock’s IBIT has accumulated $1.5 billion in net inflows, despite a broader crypto market downturn that saw Bitcoin's price drop from a 2026 high of $97,000 to $72,100. Robert Mitchnick, BlackRock’s digital assets head, remarked in March that IBIT investors tend to be "disproportionately long-term buy and hold" investors, even amid significant selling pressure in the Bitcoin market. Meanwhile, Amy Oldenburg, Morgan Stanley’s digital asset head, highlighted in a Bloomberg interview that MSBT was the bank’s most successful ETF launch to date. She noted, "This is just the first of a long roadmap of new products on the asset management side." Morgan Stanley has also filed to list a staked Ether (ETH) ETF and Solana (SOL) ETF. With the recent inflows, U.S. spot Bitcoin ETFs are nearing a year-to-date net inflow. The Bitcoin ETFs concluded 2025 with $56.59 billion in net inflows and currently stand at $56.51 billion, just $80 million shy of returning to their initial inflow figures for the year. #BlackRock#BitcoinTrust#BitcoinETF#MarketInflows#Fidelity#MorganStanley#Cryptocurrency#Bitcoin#ETFs#Investment#DigitalAssets#USIranConflict#CryptoMarket#BTC#ETH#SOL