@TFGames · Post #2041 · 01.02.2024 г., 01:51
#TDF#SR https://testflight.apple.com/join/AiaYisrO
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
Пребарај: #tdf
@TFGames · Post #2041 · 01.02.2024 г., 01:51
#TDF#SR https://testflight.apple.com/join/AiaYisrO
@TFGames · Post #1696 · 28.12.2023 г., 04:40
#TDF#SR#GAMES https://testflight.apple.com/join/AiaYisrO
@TFGames · Post #1620 · 23.12.2023 г., 20:40
#TDF#SR#GAMES https://testflight.apple.com/join/AiaYisrO
@militantwire · Post #1869 · 14.05.2022 г., 19:05
🇺🇦🏴Anarchist militia fighting for the Territorial Defense Forces (#TDF), Black Flag #Ukraine, posted a picture of their fighters and the van that they’ve purchased with money donated from foreign comrades and sympathizers for use in their defense against #Russia|n invasion: https://twitter.com/potempkinbrain/status/1525552737978486785?s=21&t=hZN_K_M8lGqjeymUduF7ZQ
@addisstandardeng · Post #21277 · 02.02.2026 г., 11:01
#Op_ed: One Year On: Impact of senior commanders’ statement on #Tigray’s post-war transition Reflecting on the one-year anniversary of the January 2025 statement by senior Tigray forces leaders (#TDF commanders), Gebremeskel Hailu examines the “political, institutional, and humanitarian consequences of militarized interventions.” While the commanders raised legitimate grievances over stalled peace and humanitarian crises, he argues their intervention “entrenched political polarization and widened the political and military divide.” By endorsing a #TPLF faction and forcibly removing local officials, the military abandoned neutrality, exposing a “widening gap between rhetoric and practice.” The episode also revealed “deep inconsistencies” in disarmament decisions, “influenced more by political alignment than by principled security concerns.” Gebremeskel concludes that “durable recovery depends on civilian-led, inclusive, and legally grounded governance processes.” https://addisstandard.com/?p=54882
@borkena · Post #5962 · 09.03.2026 г., 06:35
"የጸረ-ድሮን ቴክኖሎጂ ታጥቀናል" ጄነራል ምግበይ በህወሓት የሚመራው እና ራሱን የትግራይ ሰራዊት ወይም TDF ብሎ የሚጠራው ኃይል "የጸረ-ድሮን ቴክኖሎጂ ታጥቋል” - ሲሉ ብ/ጄነራል ምግበይ ተናገሩ። የሰራዊቱ የምዕራብ ግንባር አዛዥ እንደሆኑ የሚናገሩት ብሪጋዴር ጄነራል ምግበይ ኃይለ፣ የትግራይ ሰራዊት የጸረ-ድሮን ቴክኖሎጂን ጨምሮ ስትራቴጂካዊ መሳሪያዎችን መታጠቁን ይፋ ተናግረዋል። ጄነራሉ ከድምጺ ወያነ ቴሌሊ ጋር ባደረጉት ቃለ-ምልልስ፣ ሰራዊቱ በቴክኖሎጂ የዳበረና ለማንኛውም ጥቃት የተዘጋጀ መሆኑን ገልጸዋል። በዚሁ ቃለምልልሳቸው ላይ “ለድሮን ጸረ-ድሮን፣ ለታንክ ጸረ-ታንክ መታጠቃችን ሊታወቅ ይገባል” ያሉት ጄነራል ምግበይ "ሰራዊቱ የህዝብ እንጂ የግለሰብ ፍላጎት ማስፈጸሚያ እንዳልሆነም ይታወቅልን" ሲሉ ተናግረዋል። #Ethiopia#Tigray#TDF#Ethiopiannews#news#ህወሃት#ጄነራልምግበይ#መቀሌ