TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #400 · 8 дек.

Три способа выполнить множество задач с asyncio Функция для примера: async def do_it(n): await asyncio.sleep(random.uniform(0.5, 1)) return n 1. Последовательный вызов async def main(): for i in range(100): result = await do_it(i) Такой вызов имеет смысл только тогда, когда результат одной задачи требуется для вызова следующей. Если они независимы, то это антипаттерн, так как аналогичен простому синхронному вызову по очереди. 2. Упорядоченный результат async def main(): tasks = [do_it(i) for i in range(100)] results = await asyncio.gather(*tasks) Выполняет корутины конкурентно и возвращает результат в виде списка. Полезен когда требуется получить результаты в том же порядке в котором задачи отправлены. 3. Результат по мере готовности tasks = [asyncio.create_task(do_it(i)) for i in range(100)] for cor in asyncio.as_completed(tasks): result = await cor Так же выполняет корутины конкурентно, но не гарантирует порядок. Результат возвращается по мере готовности, каждый отдельно. Полезен когда нужно обработать любой ответ как можно скорее. #async

Hashtags

Резултати

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

Пребарај: #mvd

当前筛选 #mvd清除筛选

There are currently no cases of #MarburgVirusDisease in Nigeria. However, measures have been taken to strengthen preparedness for #MVD in Nigeria. Nigerians are urged to AVOID ALL BUT ESSENTIAL TRAVEL to Equatorial Guinea at this time. 📜Press release: https://ncdc.gov.ng/news/440/ncdc-on-alert-following-the-announcement-of-the-marburg-virus-disease-outbreak-in-equatorial-guinea

International News

@intnewsagency · Post #8878 · 24.03.2026 г., 13:45

Deputy Plotnikov Urges Police Resignees to Join Special Military Operation In Perm, Deputy Vladimir Plotnikov proposed adding police officers who resign to the Special Military Operation (SMO) lists, citing low salaries and existing training. He emphasized duty to the Motherland and noted SMO pays better. Despite this, Plotnikov himself is a millionaire owning luxury cars and real estate. Last year, over 80,000 officers left the Ministry of Internal Affairs, worsening the staffing crisis. #Russia#MVD#SMO#Plotnikov The main news of Russia and the world ishere.

International News

@intnewsagency · Post #8558 · 17.03.2026 г., 13:22

Russian Ministry of Internal Affairs Launches Digital Program to Reduce Bureaucracy and Police Workload In 2025, the Russian Ministry of Internal Affairs lost 80,000 employees—40% more than new recruits—leading to a regional staffing deficit exceeding 25%, threatening law enforcement efficiency. Minister Kolokoltsev has ordered optimization of paperwork and digitalization of processes while enhancing social guarantees for officers. These measures aim to improve working conditions and retain personnel. #MVD#police#digitalization#staffing#Russia The main news of Russia and the world ishere.