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

Резултати

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

Пребарај: #drones

当前筛选 #drones清除筛选
Voir de ses propres yeux

@voir_yeux · Post #12017 · 07.03.2026 г., 09:14

🇷🇺🇺🇦La défense aérienne russe a abattu 124 drones ukrainiens au-dessus des régions russes au cours de la nuit dernière, a annoncé le ministère russe de la Défense. #russie#drones

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #23837 · 13.04.2026 г., 11:33

【🚀 傳統金融|華爾街日報:香港成伊朗洗錢據點,48 億美元地下金流曝光 】 #Drones#Geopolitics 📍 請見報導: https://abmedia.io/hong-kong-iran-money-laundering-exposed 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

Indian Development News 🇮🇳

@developmentnewsindia · Post #44430 · 05.05.2026 г., 05:53

Indian startup Hoverit completed vehicle-mounted launch trials of its Divyastra Mk-2 long-range attack drone, with rocket-assisted takeoff testing next. The Divyastra Mk-2 has a range of 1,500–2,000 km, payload of 50–100 kg, and incorporates AI swarm intelligence with GPS-denied navigation capability. #Drones#Defence https://defence-blog.com/india-builds-a-shahed-type-strike-drone-with-2000-km-range/

Indian Development News 🇮🇳

@developmentnewsindia · Post #44124 · 27.04.2026 г., 11:53

India just unveiled a supersonic loitering munition 🇮🇳 Meet Super Kaatil built by Dynamatic Technologies. A drone that combines the precision of a loitering munition with supersonic speed. Here is what it actually is👇 • 100 kg platform powered by a compact jet engine • Supersonic speed, faster than any conventional loitering munition • 350 km strike range for deep strike missions • 35 kg warhead for high value targets • Works in GPS denied and jammed environments • Terrain following flight to stay under radar coverage The original Kaatil had a 100 km range. Super Kaatil triples that and adds supersonic speed on top. #Drones#Defence

Indian Development News 🇮🇳

@developmentnewsindia · Post #44082 · 26.04.2026 г., 06:27

BREAKING: India is reshaping air warfare with the ADC-S (Air Dropped Canisterised Swarm) project, turning transport aircrafts into long-range stand-off strike platforms. The system can deploy multiple autonomous #drones from airborne canisters for deep strikes over 500 km away, even in GPS-denied environments, with high precision. Built under an indigenous framework, ADC-S signals India’s shift from platform-centric warfare to scalable swarm warfare and autonomous combat systems. #Defence https://fxtwitter.com/i/status/2048041840805581203

Indian Development News 🇮🇳

@developmentnewsindia · Post #43527 · 12.04.2026 г., 16:00

Chief of the Army Staff General Upendra Dwivedi visited New Space Research & Technologies, where he was briefed on the organisation’s indigenous capabilities in unmanned and high-altitude systems. The interaction highlighted advancements in swarm drone technologies and ISR capabilities, critical for ensuring persistent surveillance and robust communication support in harsh operational environments. #Drones#Defence

Indian Development News 🇮🇳

@developmentnewsindia · Post #44294 · 01.05.2026 г., 14:20

Major relief to India's drone industry Conflict in West Asia has severely impacted their supplies and deliveries, causing heavy penalties for delays beyond their control. The Ministry of Finance now clarifies: if your contract was disrupted by the West Asia situation, you will receive an additional 2 to 4 months and face no fines. Fair and practical. #Drones#policy

123•••89
ПретходнаСтраница 1 од 9Следна