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

Резултати

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

Пребарај: #baltic

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

@american_observer · Post #5707 · 24.04.2026 г., 22:59

📰 Europe’s New Nuclear Theater France and Poland are reportedly preparing drills that simulate nuclear strikes on targets in Russia and Belarus, with Rafale jets and Polish strike aircraft involved in scenarios over the Baltic and northern Poland. Moscow’s answer was immediate: if French nuclear-capable bombers show up on EU soil, some European countries could end up on Russia’s target list too. That is the absurd beauty of European deterrence politics right now. Everyone calls it defense, everyone calls it stability, and everyone keeps moving closer to the edge while insisting the other side is the one escalating. Poland wants protection. France wants relevance. Russia wants to remind Europe that nuclear signaling is not a parlor game, even when it is dressed up as alliance coordination and “extended deterrence.” The real problem is that these drills are no longer just about military readiness. They are also public messaging, meant to show resolve, reassure allies, and advertise a new European balance of power that still depends on a very fragile chain of assumptions. And that chain only needs one panic, one misread move, or one political showman too many before the theater starts looking less like deterrence and more like rehearsal for catastrophe. #France#Poland#Russia#nuclear#Baltic#Europe 📱American Оbserver - Stay up to date on all important events🇺🇸

🚢Viking Line фиксирует рост международного пассажиропотока в Балтийском регионе. Финская паромная компания Viking Line сообщает о продолжающемся росте международного туризма в Северной Европе, где круизы по Балтийскому морю становятся важной частью туристических маршрутов. За последний год компания перевезла ок 4,6 млн пассажиров, при этом более половины из них — иностранные туристы. Наиболее динамичный рост наблюдается со стороны Азии, особенно Китая, где пассажиропоток увеличился в несколько раз за последние два года. Рост международного туризма усиливает значение паромных перевозок как ключевого элемента региональной логистики. Такие перевозки объединяют короткие круизные маршруты, транспорт и размещение, повышая эффективность туристических маршрутов. Дополнительно важным фактором становится изменение сезонности: иностранные туристы путешествуют более равномерно в течение года, что снижает зависимость операторов от летнего пика спроса. Таким образом, сегмент каботажных и паромных перевозок в Балтийском регионе демонстрирует устойчивый рост, поддерживаемый глобальными туристическими трендами и улучшением транспортной доступности. 📌Viking Line Abp - основана в 1959 году, публичная финская паромная компания, базируется на Аландских островах, принадлежит институциональным инвесторам и частным акционерам. Крупнейшими акционерам являются Skandinaviska Enskilda Banken (SEB) - около 20% и частный инвестор Якоб Йоханссон - чуть более 20%. #ferries#tourism#Baltic#shipping#logistics

🚢Wallenius Lines консолидирует Wallenius SOL, став единственным владельцем. Шведская Wallenius Lines заключила соглашение о выкупе доли SOL Group в компании Wallenius SOL, получив полный контроль над оператором. Сделка направлена на усиление стабильности и долгосрочного развития бизнеса в Северной Европе. Wallenius SOL играет ключевую роль в обеспечении логистики в регионе Балтийского моря, Ботнического залива и Северного моря, связывая промышленность Швеции и Финляндии с европейскими рынками и Великобританией. При этом операционная деятельность и стратегия компании останутся без изменений. С отраслевой точки зрения сделка отражает тренд консолидации в региональных логистических сегментах, где контроль над активами и цепочками поставок становится критическим фактором. Полная интеграция позволяет повысить эффективность управления и усилить инвестиционные возможности. Дополнительно акцент сделан на растущую роль каботажного судоходства как элемента оптимизации региональной логистики в Европе. 📌Wallenius Lines - основана в 1934 г, частная судоходная компания, принадлежит семье Валлениус (Швеция). #shipping#logistics#Baltic#shortsea#infrastructure

🚢Tallink сдаёт в чартер паром типа Ro-Pax "Superfast IX" и ищет замену на линии Балтики. Эстонская Tallink Grupp передала паром "Superfast IX" в трёхлетний чартер с опционом продления и возможного выкупа судна. Передача запланирована на май, при этом судно продолжит работу до момента сдачи. Компания уже ищет замену для линии Paldiski–Kapellskär, так как текущий паром считается избыточным по пассажировместимости для данного маршрута. С операционной точки зрения, сделка позволяет Tallink оптимизировать флот и обеспечить стабильный денежный поток, перераспределяя тоннаж в более эффективные сегменты. Для рынка это сигнал гибкого управления флотом в сегменте паромных перевозок, где соответствие судна конкретному маршруту становится ключевым фактором эффективности. 📌Tallink Grupp AS — основана в 1989 году в Эстонии, крупнейший оператор паромных перевозок в Балтийском регионе; публичная компания. Контролирующий акционер: AS Infortar (68–69%), — инвестиционная компания с ключевыми бенефициарами: Enn Pant (сооснователь Tallink) и Paavo Nõgene (CEO Infortar и Tallink). #Shipping#Ferries#RoPax#Baltic#Chartering

🎙 Briefing by Russia's Foreign Ministry Spokeswoman Maria Zakharova (Moscow, November 7, 2025) 🔹Outcomes of Russia’s UNSC Presidency 🔹Kiev regime crimes 🔹Ukraine crisis 🔹Estonia’s introduction of a “fee for energy independence from Russia” 🔹Third advisory opinion of the UN International Court of Justice regarding Palestine 🔹Election of the new UNESCO Director-General during the 43rd session of the UNESCO General Conference 🔹The signing of a peace declaration by Cambodia and Thailand 🔹 2025 BRICS+ Counter-Terrorism Conference 📰Read 📺Watch #UN#UNGA On October 31, the Russian Federation completed its Presidency of the UN Security Council. During this period, the Council held a total of 22 meetings and 11 consultations. A broad range of conflict situations across nearly all regions of the world, as well as other pressing challenges to international peace and security, were considered. Russia’s Presidency reaffirmed our country’s strong authority as a founding member of the UN and a permanent member of its Security Council. The Russian Side made every effort to ensure the Council’s effective and result-oriented work. We will continue to work to ensure that the Council remains an effective tool for coordinating efforts to find collective responses to threats to international peace and security. #KievRegimeCrimes The Kiev neo-Nazi regime continues to attack civilian targets, terrorising the civilians in Russia. Over the past week, more than 70 Russian citizens suffered in artillery and drone strikes — 8 were killed and 63 injured, including 4 children. The brutal practice of deliberately targeting civilians by the Ukrainian neo-Nazis has been reported in all populated areas along the front line. #Estonia#Baltic#Vandalism Moscow is outraged by reports of yet another act of state vandalism in Estonia, this time against the memory of Soviet soldiers buried in the town of Loksa. In a profoundly disrespectful act, the remains of sailors from the destroyer Karl Marx and other Soviet soldiers who died fighting the Nazis between 1941 and 1945 have been exhumed using an excavator. Russia strongly condemns the immoral and criminal campaign being waged in Estonia to desecrate the remains of fallen anti-Nazi fighters. We reiterate that the destruction, damage, or desecration of war graves, even beyond Russia’s borders, is a criminal offence under the Criminal Code of the Russian Federation. #UNESCO On November 6 this year, the UNESCO General Conference, currently being held in Samarkand, elected the Organisation’s new Director-General – the renowned scholar and Egyptologist, former Egyptian Minister of Tourism and Antiquities, Khaled Ahmed El-Enany – for the term from 2025 to 2029. We welcome this decision. We are encouraged by the new Director-General’s pragmatic and constructive approach. #Cambodia#Thailand#ASEAN We welcome the signing of a joint declaration to settle the border conflict by Cambodia and Thailand at the ASEAN Summit in Kuala Lumpur on October 26. We remain confident that the arrangements arrived at with the assistance of Malaysia’s ASEAN Chairship will help overcome existing differences peacefully, establish a close bilateral dialogue, and ensure that the normalised situation will last long and remain durable. We believe many territorial disputes around the world are a legacy of Western colonial policy. Considering the worsening situation in the Asia-Pacific region, it is important to act in the spirit of unity and solidarity which is a hallmark of ASEAN.