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

Пребарај: #stakingrewards

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

@CryptoM · Post #65441 · 13.04.2026 г., 08:34

🚀 Japanese Game Company WIZE Expands Solana Holdings Japanese game company WIZE, formerly known as Mobcast Holdings, has announced that its cumulative purchase of SOL has reached approximately $3.13 million (500 million yen) as of April 10, 2026. According to Foresight News, the company currently holds over 24,597 SOL, with an average purchase price of around $127 (20,327 yen) per SOL, ranking 15th globally on CoinGecko's 'Solana Treasury Holdings' list. Over the past six months, WIZE has earned more than 400 SOL in staking rewards. The company's 'WIZE Validator Node' has officially joined the Solana Foundation's SFDP program and has received delegations from projects like DoubleZero. Including external delegations, WIZE's total treasury amounts to approximately 152,000 SOL. The company aims to further increase its holdings to enter the top 10 globally as soon as possible. #JapaneseGameCompany#WIZE#Solana#SOL#ForesightNews#SolanaTreasuryHoldings#StakingRewards#WIZEValidatorNode#SFDP#DoubleZero#Crypto#Blockchain#Cryptocurrency#GameIndustry