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

Резултати

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

Пребарај: #hytale

当前筛选 #hytale清除筛选
科技&趣闻&杂记

@kejiqu · Post #4084 · 20.01.2026 г., 04:04

2026 最火沙盒 RPG 游戏《Hytale》成功运行 Win95,还能套娃游戏 沙盒RPG新作《Hytale》开启抢先体验仅一周,其模组社区已展现出惊人创造力。工程师Sadat Sahib成功在游戏内运行Windows 95操作系统,并实现了“套娃”式操作,即在《Hytale》中运行《Hytale》和《Minecraft》。该游戏由《Minecraft》服务器团队Hypixel开发,内置专业创作工具,强调“创作者优先”。《Hytale》上线首日玩家数突破280万,Twitch平台观众数超过42万,登顶全球游戏直播榜首。尽管开发历经波折,该游戏凭借强大的模组潜力及独特的玩法策略,迅速成为热门沙盒RPG。IT之家 🏷#Hytale#模组#Windows 📢频道👥群组📝投稿

GitHub Trends

@githubtrending · Post #15206 · 09.10.2025 г., 13:00

#javascript#3d#blockbench#electron#hytale#low_poly#minecraft#pixel_art Blockbench is a free, easy-to-use program for making low-poly 3D models with pixel art textures, perfect for beginners but also packed with advanced tools for experts[1]. You can paint and edit textures right inside the program, create animations, and export your models for games, 3D printing, or sharing online—including special formats for Minecraft Java and Bedrock Edition[1][3]. The interface is modern and customizable, and you can add even more features with plugins[1]. Since Blockbench is open source, you can use, change, and share it freely, and anything you create belongs to you[1]. This makes it a powerful, flexible tool for anyone interested in 3D modeling, especially for game design and Minecraft content creation. https://github.com/JannisX11/blockbench