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 слични објави

Пребарај: #glacier

当前筛选 #glacier清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #451 · 28.07.2025 г., 20:22

🌎 Some Himalayan glaciers are “surge glaciers,” moving up to 100 times faster than normal for short periods. These icy rivers can suddenly speed up, advancing kilometers in months instead of centuries—reshaping valleys with astonishing power. ✨ #glacier⚡#Himalayas⚡#earth 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #594 · 20.08.2025 г., 13:22

🌎 Greenland’s Ilulissat Icefjord is packed with icebergs from one of the world’s fastest glaciers. Its towering ice flows calve off at such speed that they helped inspire the iceberg that sank the Titanic! ✨ #glacier⚡#iceberg⚡#Greenland 👉subscribe Interesting Planet

Reuters: World

@reutersworldchannel · Post #149185 · 10.10.2021 г., 16:36

Glacier covered in massive blanket to stop melting A cloth sheet used to shield part of the Helags glacier in northern Sweden over the summer saved at least 3.5 meters in height from melting, according to organizers of the private initiative, the first of its kind in Scandinavia. #News#Reuters#environment#globalwarming#Sweden#glacier Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖