@developmentnewsindia · Post #44271 · 01.05.2026 г., 03:23
India among 6 countries placed on US Trade Representative priority watch list. #geopolitics
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
Пребарај: #geopolitics
@developmentnewsindia · Post #44271 · 01.05.2026 г., 03:23
India among 6 countries placed on US Trade Representative priority watch list. #geopolitics
Hashtags
@developmentnewsindia · Post #44262 · 30.04.2026 г., 20:27
🇦🇪⚡🇵🇰 Etihad fires 15 Pakistanis, gives 48-hour exit order: UAE signals tougher stance on Islamabad #Geopolitics https://t.co/hwWqm6bTxX
Hashtags
@developmentnewsindia · Post #44259 · 30.04.2026 г., 18:35
Russian FM Sergey Lavrov to attend BRICS FM Summit in New Delhi from 14-15 May #Geopolitics
Hashtags
@developmentnewsindia · Post #44229 · 30.04.2026 г., 09:53
Indian, Italian Defence ministers agree to Bilateral Military Cooperation Plan (MCP) 2026-27 #Geopolitics
Hashtags
@developmentnewsindia · Post #44184 · 29.04.2026 г., 07:54
Vietnam President To Lam to visit India next week. #Geopolitics
Hashtags
@developmentnewsindia · Post #44163 · 28.04.2026 г., 12:43
India Condemns Terrorists Attacks in Mali #Geopolitics
Hashtags
@developmentnewsindia · Post #44134 · 27.04.2026 г., 16:40
No Consensus among BRICS members on West Asia Conflict : MEA #Geopolitics
Hashtags
@developmentnewsindia · Post #44129 · 27.04.2026 г., 15:02
🇮🇳🤝🇯🇴 Jordan joins India led International Solar Alliance (ISA), the Coalition for Disaster Resilient Infrastructure (CDRI) and the Global Biofuel Alliance (GBA) #Geopolitics
Hashtags
@developmentnewsindia · Post #44088 · 26.04.2026 г., 16:51
Spokesperson of Iran’s National Security Committee, Ebrahim Rezaei, has called Pakistan ‘not a suitable mediator and it lacks credibility and questions its neutrality. #Geopolitics
Hashtags
@developmentnewsindia · Post #44034 · 24.04.2026 г., 15:15
First BRICS statement on West Asia conflict, after BRICS Deputy Foreign Ministers and Special Envoys on the Middle East and North Africa (MENA) meet in New Delhi. #Geopolitics
Hashtags
@developmentnewsindia · Post #44023 · 24.04.2026 г., 13:18
🇺🇳 UNGA President Annalena Baerbock to visit India on April 28th #Geopolitics
Hashtags
@developmentnewsindia · Post #43970 · 23.04.2026 г., 09:43
🇮🇷⚔️🇺🇸Report: Iran Bypasses US Naval Blockade with 34 Tankers According to cargo tracking group Vortexa, at least 34 tankers linked to Iran have successfully bypassed the US naval blockade since its inception. A significant number of these vessels were reportedly transporting Iranian crude oil, a key source of revenue for the regime. Vortexa's data indicates 19 of the vessels exited the Persian Gulf while 15 entered. Analysts suggest the current US Navy deployment is insufficient to fully enforce the blockade line. #Geopolitics
Hashtags