@Architecture_World · Post #6810 · 20.09.2021 г., 07:30
#facade by dmytrosolovyov
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
Пребарај: #facade
@Architecture_World · Post #6810 · 20.09.2021 г., 07:30
#facade by dmytrosolovyov
Hashtags
@arch_shovel · Post #586 · 17.08.2022 г., 06:31
Good morning by Maria Castello Martinez Architect #arch_shovel#architecture#archdaily#facade#facadedesign
@arch_shovel · Post #613 · 30.08.2022 г., 19:10
Chybik kristof unveils a newly designed private art gallery, defined by its shimmering facade of moveable copper tiles. the cluster of vertical cylinders are animated by the dynamic skin, which will gradually transform with a patina over time. Visualization: monolot.studio #rendering#cgi#facade#architect#archidaily#arch_shovel
@arch_shovel · Post #510 · 07.07.2022 г., 15:41
Mood of the day. Nhow Hotel. Image by Proloog Architecture: OMA #3d#render#archviz#visualization#architecture#facade#building#arch_shovel
@arch_shovel · Post #723 · 03.10.2022 г., 14:48
Happy World Architecture Day! Visualization: Plo.mp Project: Mixed-Use Complex with Kohn pedersen fox . #rendering#facade#architect#archidaily#minimalist#detail#architecturelover#arch_shovel
@arch_shovel · Post #746 · 15.10.2022 г., 19:50
B U B B L E H O U S E / Cheng Dong. A coherent city / Sangu Design The Human Condition by Hannah Arendt says that world is like a table that brings people together and separates people from each other. People yearn to see each other in the city; they call for a new connection which is beyond age, experience, boundaries, it also can transcend personal loneliness and urban barriers. . When the architect design and construct from the perspective of the user, they therefore are willing to respect the vitality of the building and rationally make use of the existing rules and conditions to practice the possibility of the local urban lifestyle. #facade#elevation#interior#urbanplan#geometricarchitecture#glassfacade#interiordesign#composition#modulararchitecture#building#arch_shovel