@YukiPhotoCollection · Post #546 · 21.12.2018 г., 06:25
#Remhttp://www.pixiv.net/member_illust.php?mode=medium&illust_id=60107707
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
Пребарај: #rem
@YukiPhotoCollection · Post #546 · 21.12.2018 г., 06:25
#Remhttp://www.pixiv.net/member_illust.php?mode=medium&illust_id=60107707
Hashtags
@re_pics · Post #8244 · 01.04.2024 г., 00:18
━━━━━━━━🔮🔮━━━━━━━ #wallpaper#Rem 🔰ᐈCharacter: Rem 🔰ᐈSource: Re:Zero 『 @Re_pics 』 ━━━━━━━━🔰🔰━━━━━━━━
Hashtags
@re_pics · Post #8242 · 01.04.2024 г., 00:18
━━━━━━━━🔮🔮━━━━━━━ #wallpaper#Rem 🔰ᐈCharacter: Rem 🔰ᐈSource: Re:Zero 『 @Re_pics 』 ━━━━━━━━🔰🔰━━━━━━━━
Hashtags
@re_pics · Post #8240 · 01.04.2024 г., 00:18
━━━━━━━━🔮🔮━━━━━━━ #wallpaper#Rem 🔰ᐈCharacter: Rem 🔰ᐈSource: Re:Zero 『 @Re_pics 』 ━━━━━━━━🔰🔰━━━━━━━━
Hashtags
@ryuzuxhii · Post #30019 · 30.04.2026 г., 06:44
#Dipansh_00 #Rem
Hashtags
@RedOtaku · Post #278 · 01.03.2018 г., 18:19
#Wallpaper#Rem#ReZero
Hashtags
@YukiPhotoCollection · Post #550 · 22.12.2018 г., 16:06
#Rem#Ramhttp://www.pixiv.net/member_illust.php?mode=medium&illust_id=61258301
@cosplayuploadtest2 · Post #101808 · 23.03.2025 г., 02:41
Title: PuyPuyChan___Rem_Wedding Authors: #None Tags: #None#PuyPuyChan #_ #Rem#Wedding recommendation: None TelegraphLinks:page-0-25
Hashtags
@wall_amv · Post #8831 · 29.04.2024 г., 09:40
#anime #art #Re_zero #Emilia #Rem #Fan_Art #Girl #AnimWorld @Wall_Amv
@figuronyan · Post #107 · 03.05.2024 г., 19:27
#Rem#Re_Zero_kara_Hajimeru_Isekai_Seikatsu#noodle_stopper#noodle Я люблю Эмилию
@figuronyan · Post #114 · 03.05.2024 г., 19:44
#Rem#Re_Zero_kara_Hajimeru_Isekai_Seikatsu#bunny#b_style
@raremet2026 · Post #65 · 24.04.2026 г., 12:50
🌏Almost 600 participants from 19 countries have registered for the RAREMET-2026 Congress We are publishing the latest information about registration for the International Congress on Rare Metals, Materials and Technologies, which will be held in Moscow from May 20 to 22. 📊Participants from 19 countries worldwide: Russia, India, China, Kazakhstan, Republic of Korea, Mongolia, Cuba, Egypt, Belarus, Tajikistan, Uzbekistan, Pakistan, Vietnam, Bangladesh, Armenia, Iran, Malaysia, Singapore, South Africa. The largest delegation is from India. 🎓High scientific status: – 3 academicians and 11 corresponding members of the Russian Academy of Sciences - more than 50 professors, 64 doctors of sciences, 133 candidates of sciences 👩🔬Support for young researchers: – more than 220 young scientists under the age of 35 📌The Congress includes four thematic conferences (RAREMET:Minerals, RAREMET:Metallurgy, RAREMET:Chemistry, RAREMET:Functional), round tables, as well as an expert session on fire and explosion safety 🏭 The RAREMET:Expo exhibition will be held as part of the Congress, intergovernmental meetings (G2G) and a press-conference are also planned. 📖 The full text of the news is available on the Congress website. 🗓 RAREMET-2026 will be held on May 20-22 in Moscow at the RTU MIREA. The organizer is Giredmet JSC. 🌐 Website of the Congress: redmet.giredmet.ru 📱MAX: max.ru/id7707072637_gos22 See you at the key forum of the rare metal industry! #RAREMET2026#RAREMET2026#RareMetals#REM#technologicalsovereignty#RAREMETExpo