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

Пребарај: #web3ai

当前筛选 #web3ai清除筛选
EdgeMarket.AI 📣

@edgemarketai · Post #8169 · 09.05.2026 г., 11:11

The internet rewards attention. EdgeMarket is designed to reward accuracy. We are building a decentralised validation layer where communities collectively identify signal, filter noise, and strengthen truth through time. Noise: • Clickbait • Manipulation • Speculation • Fear • Bias Signal: • Clarity • Accuracy • Alignment Maybe the future isn’t predicted. Maybe it’s discovered. $SIGNAL powers the ecosystem. Validate. Earn. Shape the future. #EdgeMarket#SIGNAL#Web3AI#TruthValidation#CollectiveIntelligence

GPT360

@gpt360_announcement · Post #1549 · 08.04.2025 г., 09:44

🚨𝐆𝐏𝐓𝟑𝟔𝟎 𝐢𝐬 𝐣𝐨𝐢𝐧𝐢𝐧𝐠 𝐭𝐡𝐞 𝐇𝐲𝐫𝐚 𝐀𝐌𝐀!🚨 Hey Web3 fam! We're excited to announce that our CMO Anton Sheleg will be joining an epic AMA session hosted by Hyra101 to talk all things Web3 AI vs. centralized giants — and why this revolution is just getting started👀 ⬇️ 𝐓𝐨𝐩𝐢𝐜: AI Wars 2025: Can Web3 AI Overtake Centralized Giants? ⬇️ 𝐃𝐚𝐭𝐞: April 8, 2025 ⬇️ 𝐓𝐢𝐦𝐞: 13:00 (UTC) ⬇️ 𝐖𝐡𝐞𝐫𝐞: https://x.com/i/spaces/1OdJrDmzzrlKX ⚡️ 𝐏𝐚𝐫𝐭𝐢𝐜𝐢𝐩𝐚𝐧𝐭𝐬: GPT360, Hyra Network, GPUAI 🔥 We'll be diving deep into strategy, vision, and what’s next for AI on-chain Tag your friends, bring your questions, and see you there! #GPT360#HyraNetwork#AIWars2025#Web3AI#AMA#DecentralizedAI

Crypto M - Crypto News

@CryptoM · Post #65388 · 13.04.2026 г., 04:14

🚀 AINFT Platform Surpasses 700,000 Users, Advances in Web3 AI The AINFT platform has officially exceeded 700,000 users, according to official data. According to Odaily, the growing user base and the continuous enhancement of AI model capabilities are propelling it to become a leading AI platform in the Web3 sector. AINFT currently offers users AI models ready for production and fully supports the execution of on-chain automated workflows, facilitating a rapid transition from creative ideas to on-chain implementation. Leveraging its expanding community and open technical architecture, AINFT aims to lower the barriers to using Web3 AI, enabling more efficient deployment of innovative applications. #AINFT#700000Users#Web3#AIPlatform#AI#Blockchain#OnChain#AutomatedWorkflows#Web3AI#Innovation#Technology#Community