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

Пребарај: #climatetech

当前筛选 #climatetech清除筛选
ChatGPT AI Technology News

@chatgpt_officialnews · Post #262 · 28.08.2025 г., 09:02

🌐Climate Tech Gets an AI Upgrade! AI isn’t just about chatbots and robots — it’s now being used to fight climate change.🌱 Recent breakthroughs show AI can: ✔️ Predict extreme weather with higher accuracy. ✔️ Optimize energy grids for renewable power. ✔️ Reduce waste in agriculture and water usage. ✔️ Help cities design smarter, greener infrastructure. This could mean billions saved in disaster response and a faster transition to clean energy. But… the big question is: Will governments and companies adopt it fast enough?⌛ Would you trust AI to manage your city’s energy? ➖➖➖➖🔻 🧠 BOT: @Chatgpt_OfficialBOT 💎@Chatgpt_OfficialNews #️⃣#AI#ClimateTech#Innovation#NeuralHubAI ➖➖➖➖🔺

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40952 · 19.04.2026 г., 06:03

In Iceland, the CarbFix project captures CO2 from geothermal power plants. The CO2 is mixed with water and injected deep underground into basalt rock. It reacts with minerals in the rock and forms stable carbonate rock. The system has been operating at the Hellisheiði geothermal power plant. 🪨🌍💧⚗️ [Read more] @googlefactss #CarbonCapture#Iceland#CO2#ClimateTech

Venture Village Wall 🦄

@venturevillagewall · Post #3646 · 21.12.2024 г., 10:24

Accelergen Energy Raises $20M Accelergen Energy has secured $20 million in funding as of December 19, 2024. The firm focuses on delivering clean power assets characterized by robust and sustainable locational value through strategic investments, development, commercialization, and optimized operations. For more details, visit Accelergen Energy. #Accelergen#Energy#Funding#CleanPower#Investment#Sustainability#RenewableEnergy#Development#Commercialization#Operations#ClimateTech#GreenEnergy#Ecosystem#Infrastructure#PowerAssets#Technology#StrategicInvestment#CleanTech#EcoFriendly#LocationalValue

IELTS|Newspapers & Magazines|English

@emagzinewspars · Post #9365 · 18.10.2025 г., 09:37

#The_Time🇺🇸📕[PDF]⬇️ 27 #October2025 #Weekly_Magazines For learning, for free(dom). @backupofmagazines Meet the #Future of invention in TIME’s Best Inventions of 2025! 🤖 From humanoid robots folding laundry (#AI), to lab-grown #salmon, wildfire defense tech, and personalized #healthcare, this issue showcases 50+ breakthroughs that redefine home, work, and #sustainability. Discover how #FigureAI leads the #robotics revolution, dive into the #Barbie phenomenon, explore the rise of “Baby Boxes,” and relive the final #StrangerThings. A must-read collection for #tech lovers and #innovators alike. #BestInventions2025#Innovation#FutureOfWork#ClimateTech#Biotech#Netflix#HumanAI#TimeMagazine