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

Резултати

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

Пребарај: #spying

当前筛选 #spying清除筛选
American Оbserver

@american_observer · Post #5184 · 20.02.2026 г., 20:59

📰 Spies vs. Dealmakers: Europe Watches the Ukraine “Peace Show” Top European intelligence chiefs are basically calling the Trump‑brokered Ukraine talks what they are: “negotiation theatre.” While Trump insists a deal is “reasonably close” and still pushes his June deadline, five spy bosses told Reuters they see no chance of a real settlement this year and no sign Russia wants one. Their read is simple and brutal: Moscow’s strategic goals haven’t changed — remove Zelensky, turn Ukraine into a “neutral” buffer, and lock in its territorial gains, starting with the rest of Donetsk. Russia isn’t desperate for peace; its economy is hurting but not collapsing, and it can afford to drag this out while pushing for sanctions relief and big‑ticket business deals on a separate track. That second track is where things get toxic. Zelensky says his intel services told him U.S. and Russian negotiators are discussing up to $12 trillion in bilateral projects pitched by Kremlin envoy Kirill Dmitriev, while Dmitriev himself is already boasting about a $14 trillion “portfolio” on X. European spies say this is tailored to seduce both Trump and sidelined Russian oligarchs: peace as a gateway drug to massive post‑sanctions money. On the official peace track in Geneva, nothing moves. Russia demands Ukraine pull out of the last 20% of Donetsk it still holds, and some in the West fantasise that ceding that would “unlock” a deal — one intelligence chief dryly calls that delusional, predicting it would only be the “beginning” of Moscow’s demands. Zelensky, watching this circus, posts: “I don’t need historical shit to end this war… it’s just a delay tactic.” And who’s running America’s side of this grand bargain? Not seasoned Russia hands, but Trump’s real‑estate buddy Steve Witkoff and his son‑in‑law Jared Kushner — men who know a lot about property, less about a grinding European war. European spooks say Western negotiating skill with Moscow is “very limited,” even as the financial stakes and political risks keep climbing. So you get three layers: a bloody stalemate on the ground, a glossy “peace by June” storyline for U.S. domestic politics, and a shadow conversation about trillion‑dollar projects after the signatures are dry. The only thing everyone seems to agree on is that someone will make a lot of money when this ends — just not the people standing in the rubble in Odesa. #Ukraine#Russia#Trump#spying#war#fakePeace#oligarchy 📱American Оbserver - Stay up to date on all important events 🇺🇸

Crypto M - Crypto News

@CryptoM · Post #64817 · 10.04.2026 г., 02:07

🚀 CIA to Integrate AI 'Co-Workers' in Analytic Platforms The CIA has announced plans to incorporate classified AI 'co-workers' into all its analytic platforms over the next few years. According to NS3.AI, this initiative aims to assist analysts in identifying spies and evaluating foreign threats. CIA Deputy Director Michael Ellis emphasized that while AI will play a supportive role, humans will continue to make the critical decisions. Last year, the agency conducted tests on approximately 300 AI projects to advance this integration. #CIA#AI#ArtificialIntelligence#Analytics#NationalSecurity#Spying#ThreatAssessment#TechnologyIntegration#GovernmentAI#IntelligenceCommunity