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

Резултати

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

Пребарај: #designweek

当前筛选 #designweek清除筛选

8 Architectural Installations at Dubai Design Week 2022 This year’s program is focused on designing a sustainable future. To promote this, Dubai Design Week has invited international and regional architects and designers to create installations that demonstrate creative design thinking, to introduce innovative materials, and spark conversations about the ways in which design can have a positive impact on the environment. 1. Once Upon a Forest / OBMI 2. How Much Does Your Debris Weigh? / Quartz Architects 3. IOTA / Karim Tamerji and Elias El Hage 4. Grounded in Hope / Grounded Design 5. Seven Cypresses (Seven SARV) / Banafsheh Hemmati 6. Suhail Design / Reem Al Bustani 7. KIN / FADAA 8. Al Gargoor / Sara Alrayyes #arch_shovel#designweek#dubai#architecture#installation

Nine design pieces from the Salone del Mobile 2022. 1. Biomorphic, The value of research for De Castelli. 2. Ixa, Foster+Partners for Artemide. 3. Loop, India Mahdavi for Gebrüder Thonet Vienna. 4. Riace, Ronan & Erwan Bouroullec for Magis. 5. Design Re-Generation. Università Statale di Milano, Via Festa del Perdono 7. 6. La Manufacture. Museo Poldi Pezzoli, Via Manzoni 12, Milan. 7. Tom Dixon, Twenty. Palazzo Serbelloni, corso Venezia 14. 8. Montbook, Giulio Iacchetti. Temporary Shop, via Palermo 18, Milan. 9. Again from the Earth’s Foundation. Fondazione Giangiacomo Feltrinelli, Via Pasubio 5, Milan. Photo Marco Menghi More on domusweb.it #designweek#milandesignweek#salonedelmobile#arch_shovel#milano

The most Instagrammable installation of Milano Design Week 2022. During Milan design week, designer Daniel Arsham teamed with bathroom and kitchen manufacturer Kohler to create a walking interpretation of a "sink" at a Baroque mansion. The piece, dubbed Divided Layers, is made up of seven stacked white panels that form a tunnel that is entered through a platform flanked by a water feature. #milandesignweek#milan#designweek#danielarsham#arch_shovel