@bizfeed · Post #332460 · 14.08.2025 г., 22:39
DL News | News Feed | ꘜ Crypto exchanges should block users from cashing out tokens with low ‘compliance scores,’ BIS researchers say ~ ₿izFeed#⃣:#cryptonews
Hashtags
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
Пребарај: #cryptonews
@bizfeed · Post #332460 · 14.08.2025 г., 22:39
DL News | News Feed | ꘜ Crypto exchanges should block users from cashing out tokens with low ‘compliance scores,’ BIS researchers say ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332448 · 14.08.2025 г., 21:18
The Block | 𝕏 David Bailey’s Nakamoto and KindlyMD close merger for Bitcoin treasury ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332447 · 14.08.2025 г., 21:14
unfolded. | ꘜ Long-term holders still command ~85% of all Bitcoin—near a historic high—while net outflows continue to drain exchange inventories, creating an increasingly illiquid float that can magnify price moves — link | AI comment ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332446 · 14.08.2025 г., 20:39
Blockworks | ꘜ Charting the course 📊 https://blockworks.co/news/the-state-of-solana-charts ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332445 · 14.08.2025 г., 20:39
The Block | 𝕏 US Justice Department unseals warrant to seize millions in crypto from alleged ransomeware operator ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332434 · 14.08.2025 г., 20:04
The Block | 𝕏 Bitcoin miner TeraWulf shares jump 50% after Google secures 8% stake as part of $3.7 billion 10-year AI compute deal ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332432 · 14.08.2025 г., 19:44
Blockworks | ꘜ To cut or not to cut...that is the question https://blockworks.co/news/outlining-fed-rate-cut-scenarios ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332429 · 14.08.2025 г., 19:14
The Block | 𝕏 Bitcoin Layer 2 Bitlayer raises additional $5 million in oversubscribed public token rounds on decentralized crowdfunding platforms ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332417 · 14.08.2025 г., 18:54
Blockworks | ꘜ Circle one: - Rollup - L1 https://blockworks.co/news/circle-l1-impact-ethereum ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332416 · 14.08.2025 г., 18:54
DL News | News Feed | ꘜ The US ‘won’t buy’ more Bitcoin, says Treasury Secretary ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332415 · 14.08.2025 г., 18:54
unfolded. | ꘜ Citigroup considers custody and payment services for stablecoins, crypto ETFs — link | AI comment ~ ₿izFeed#⃣:#cryptonews
Hashtags
@bizfeed · Post #332414 · 14.08.2025 г., 18:33
The Block | 𝕏 The Daily: Bessent says govt won't buy bitcoin for strategic reserve, Ethereum ICO whale sells another $5 million in ETH, and more ~ ₿izFeed#⃣:#cryptonews
Hashtags