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

Резултати

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

Пребарај: #tdesktop

当前筛选 #tdesktop清除筛选
Telegram github commits and releases

@tgappsupdates · Post #19721 · 18.04.2026 г., 00:00

telegramdesktop/tdesktop/dev • ed1e3ca • 1 files, +1/-1 Bump actions/deploy-pages from 4 to 5 Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19717 · 17.04.2026 г., 08:00

telegramdesktop/tdesktop/dev • ef848e0 • 1 files, +8/-8 Port Linux notifications to std::get_if There's no sense to use abstrations calling std::holds_alternative telegramdesktop/tdesktop/dev • 92488b2 • 2 files, +19/-26 Move GNotification action creation to the rest of notification code telegramdesktop/tdesktop/dev • bc2eb3d • 1 files, +4/-20 Remove explicit disconnections where object lifetime is the same telegramdesktop/tdesktop/dev • b5f3ea6 • 2 files, +26/-1 Try to use KSandbox::startHostProcess telegramdesktop/tdesktop/dev • 3fbe302 • 2 files, +167/-0 feat(accessibility): add screen reader support for country select box #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19716 · 17.04.2026 г., 05:45

telegramdesktop/tdesktop/dev • 66b38cc • 1 files, +9/-2 Pause animations only if video message isn't paused. telegramdesktop/tdesktop/dev • 5eed813 • 1 files, +2/-3 Fix layout for RTL messages. telegramdesktop/tdesktop/dev • 4319245 • 3 files, +204/-31 Allow seeking in video messages. #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19709 · 16.04.2026 г., 14:46

telegramdesktop/tdesktop/dev • 0e7a483 • 1 files, +1/-1 Fix muted icon outline clipping. telegramdesktop/tdesktop/dev • b87df70 • 1 files, +6/-7 Fix microphone testing in Settings. telegramdesktop/tdesktop/dev • d39af8e • 1 files, +2/-2 [ai] Fix custom command for icon creation. telegramdesktop/tdesktop/dev • ce10b71 • 1 files, +1/-1 Fix geometry counting around collapsed blockquote. telegramdesktop/tdesktop/dev • e3a34ea • 5 files, +90/-21 Cache date string in dialog rows. telegramdesktop/tdesktop/dev • f31421a • 1 files, +2/-2 Fix unread media indicator display. telegramdesktop/tdesktop/dev • 1b96772 • 1 files, +3/-3 Allow continue macOS build after partial. telegramdesktop/tdesktop/dev • 2cd90eb • 14 files, +958/-133 Add proxy auto-rotation option. #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19703 · 15.04.2026 г., 07:22

Assets for releasev6.7.6of telegramdesktop/tdesktop: • Source code (tar.gz, full) • Windows on ARM: Portable • Windows 64 bit: Portable • Windows 32 bit: Portable • Windows on ARM: Installer • Windows 64 bit: Installer • macOS 10.13+: Installer • Windows 32 bit: Installer • Linux 64 bit: Binary #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19702 · 15.04.2026 г., 06:45

New telegramdesktop/tdesktop release: v6.7.6 (stable) - Gradient-reveal animation for text appearing in messages. - Support draw-to-reply from shared media. - Frame-by-frame stepping and hold-to-speedup hotkeys in media view. - Fix loading stickers and emoji search results. - Custom emoji picker for premium quick reaction. - Search in section of pinned messages. - Recent search entries in settings search. - Hide phone number in main settings section. - Suggest sending large texts as files. - Allow creating polls with single answer option. - Bring menus and fullscreen media viewer to active space on macOS. - Fix several poll display and voting menu issues. - Fix possible crashes in chats list, url auth and others. #tdesktop

Hashtags

Telegram github commits and releases

@tgappsupdates · Post #19701 · 15.04.2026 г., 05:16

telegramdesktop/tdesktop/dev • f9d8628 • 1 files, +1/-1 Fix build with GCC. telegramdesktop/tdesktop/dev • 33dda9d • 1 files, +27/-1 Return possibility for maps handler customization on Windows. telegramdesktop/tdesktop/dev • 59e9a91 • 2 files, +7/-1 First text appearing animation duration floor. telegramdesktop/tdesktop/dev • 668a91b • 6 files, +31/-15 Version 6.7.6. - Gradient-reveal animation for text appearing in messages. - Support draw-to-reply from shared media. - Frame-by-frame stepping and hold-to-speedup hotkeys in media view. - Fix loading stickers and emoji search results. - Custom emoji picker for premium quick reaction. - Search in section of pinned messages. - Recent search entries in settings search. - Hide phone number in main settings section. - Suggest sending large texts as files. - Allow creating polls with single answer option. - Bring menus and fullscreen media viewer to active space on macOS. - Fix several poll display and voting menu issues. - Fix possible crashes in chats list, url auth and others. #tdesktop

Hashtags

123•••5•••10•••15•••20•••25•••30•••35•••40•••45•••50•••55•••60•••656667
ПретходнаСтраница 1 од 67Следна