@industriamusical2024 · Post #6111 · 22.11.2024 г., 14:36
💌ꦿ꧇ #THEME ╭⎘ Shinedown ├⎗ Theme Night .︶.︶.︶.︶.︶. ✿𝆬🫧꯭꤬→ t.me/SweetiGarden
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
Пребарај: #theme
@industriamusical2024 · Post #6111 · 22.11.2024 г., 14:36
💌ꦿ꧇ #THEME ╭⎘ Shinedown ├⎗ Theme Night .︶.︶.︶.︶.︶. ✿𝆬🫧꯭꤬→ t.me/SweetiGarden
Hashtags
@Nomad01290 · Post #4037 · 10.12.2021 г., 19:27
https://github.com/rainglow/ #theme
Hashtags
@Cateaus · Post #1382 · 22.08.2021 г., 14:23
hi this Ningning#theme💭 𖦆 ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ƒrom: @bellezaeternaaa .% 🥞 ⌗ • don't take this without permission please ! ! · · ─────── · ·
Hashtags
@Cateaus · Post #1084 · 14.08.2021 г., 14:46
hi this Karina#theme💭 𖦆 ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ƒrom: @bellezaeternaaa .% 🥞 ⌗ • don't take this without permission please ! ! · · ─────── · ·
Hashtags
@Cateaus · Post #1052 · 14.08.2021 г., 10:10
hi this Rose cyber typography#theme💭 𖦆 ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ƒrom: @bellezaeternaaa .% 🥞 ⌗ • don't take this without permission please ! ! · · ─────── · ·
Hashtags
@apcports2 · Post #959 · 20.01.2024 г., 15:14
OS: Android (OneUI5.1) Android 13 Launcher : Nothing Launcher A14 Port Share wen yours January2024 #Theme
Hashtags
@Cateaus · Post #954 · 12.08.2021 г., 07:24
hi this SinB#theme💭 𖦆 ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ƒrom: @bellezaeternaaa .% 🥞 ⌗ • don't take this without permission please ! ! · · ─────── · ·
Hashtags
@Cateaus · Post #951 · 12.08.2021 г., 07:22
hi this Yuqi#theme💭 𖦆 ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ƒrom: @bellezaeternaaa .% 🥞 ⌗ • don't take this without permission please ! ! · · ─────── · ·
Hashtags
@apcports2 · Post #834 · 05.08.2023 г., 16:27
Lockscreen Setup Rom: One UI 5.1.1 Device : SCG01 Share yours wen🤩 #Theme
Hashtags
@Cateaus · Post #400 · 27.07.2021 г., 06:20
hi this rose theme #theme💭 𖦆 ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ƒrom: @cateaus .% 🥞 ⌗ • don't take this without permission please ! ! · · ─────── · ·
Hashtags
@Cateaus · Post #317 · 26.07.2021 г., 00:27
hi this sana #theme💭 𖦆 ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ֗ ƒrom: @cateaus .% 🥞 ⌗ • don't take this without permission please ! ! · · ─────── · ·
Hashtags
@FindBlog · Post #287 · 05.09.2023 г., 13:33
WordPress 主题 Farallon 大发贱志最新款免费主题——Farallon,新鲜出炉,今天发布。 官方介绍:本主题使用古法制作,不依赖三方框架。本主题chrome lighthouse跑分几乎满分,移动端稍差也只是因为图片过大。 预览地址:https://farallon.wpista.com/ 项目地址:https://github.com/bigfa/Farallon 介绍文章:https://fatesinger.com/101971 #Theme 频道:@FindBlog 群组:@FindBlog_Group
Hashtags