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

Резултати

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

Пребарај: #ecosticker

当前筛选 #ecosticker清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #10870 · 20.12.2025 г., 16:06

Environmental Stickers for Vehicles in Uzbekistan — Free and Voluntary 🚗 📅 On December 19 of this year, the National Committee for Ecology and Climate Change, together with relevant ministries and agencies, held an awareness-raising event at the “Fayzobod” Vehicle Diagnostic Inspection Center located in the Mirabad district of Tashkent. The center operates under the Road Safety Service of the Public Security Department of the Ministry of Internal Affairs. The event was attended by representatives of government bodies, civil society institutions, non-governmental non-profit organizations, political parties, citizens’ self-governance bodies (mahallas), as well as mass media representatives. ♻️ What is an environmental sticker? An environmental sticker is not a fine or a restriction, but an indicator of a vehicle’s environmental condition. It is a symbol of the driver’s responsibility and contribution to clean air and a sustainable future for the country. ❗️Important: Environmental stickers are provided free of charge. 📍 How and to whom are the stickers issued? Environmental stickers are issued: free of charge based on the vehicle owner’s voluntary electronic application; during vehicle registration or re-registration, based on the results of the first free diagnostic inspection. 🚦 Environmental categories of vehicles Within the framework of the system, vehicles will be gradually classified into the following categories: 🟢 “clean” 🟡 “moderate” 🔴 “polluting” The category is determined according to environmental standards, while the color of the sticker reflects the level of the vehicle’s impact on the environment. 🔄 Owners of vehicles classified as “moderate” or “polluting” have the right once a year to undergo a free re-diagnostic inspection, improve the environmental category of their vehicle, and receive a new environmental sticker. 🌱 Why is this important? Despite the measures being taken, air pollution levels in the country remain high. An extremely dry autumn, annual reductions in water resources, as well as emissions from industrial enterprises and vehicles have led to the fact that Tashkent and other settlements are among the regions with high levels of air pollution. 📊 According to medical statistics, in 2024, 11,034.8 cases of respiratory and allergic diseases per 100,000 population were recorded nationwide, a significant proportion of which occurred among children. Air pollution directly affects public health, socio-economic development, and the international image of the country. 📜 Legal framework The “Environmental Transport” system is being introduced in accordance with the Resolution of the Cabinet of Ministers of the Republic of Uzbekistan dated November 28, 2025, No. 750, and will be implemented in stages: 2025–2027 — Tashkent city 2028–2030 — Nukus city and regional centers 2031–2034 — all other regions of the country 🏙 Environmental zones The boundaries of environmental zones will be determined by local Councils of People’s Deputies. Within these zones, the movement of vehicles belonging to the “moderate” and “polluting” categories without an environmental sticker will be restricted. At the same time, social and compensation mechanisms are предусмотрены for residents and workers permanently living or working in these areas. ✨ An environmental sticker is a small step with a big impact. It helps foster environmental awareness, reduce air pollution, and make our cities healthier and more comfortable to live in. 📢 Join us! Get your environmental sticker for free and become part of Uzbekistan’s environmental transformation 🌍💚 #EnvironmentalTransport#EcoSticker#CleanAir#Ecology#Tashkent#Uzbekistan ☘️ Read the latest environmental news on @ekologuz. Subscribe to our page and send your suggestions and feedback via @eklguz_bot.