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

TGINSIGHT SIMILAR POSTS

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

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

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

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

Пребарај: #facadedesign

当前筛选 #facadedesign清除筛选

Ørsted Gardens. Ørsted Gardens transformed a dilapidated building (see third image) into a new social space with semi-private decks for the individual residents. Ørsted Gardens by Tegnestuen Lokal – "If we want to achieve a sustainable future, we cannot rely on only building sustainable buildings going forward. We need to have a visionary method of transforming and adapting existing buildings to meet our changing needs. Ørsted Gardens is an example of a project that brings a generic renovation to a new level, improving the visual and social environment for residents and visitors alike." #arch_shovel#architecture#archdaily#facadedesign

3XN Architect’s proposal for SRPJ in Tokyo. The design for The Shibuya Upper West project, 𝗧𝗵𝗲 𝗪𝗮𝘃𝗲𝘀, began from the inside out – understanding the target user groups, identifying key project aspirations for this new ecosystem nestled within Shibuya and Tokyo, and ensuring a clear, uncomplicated method of articulation that amplifies the spatial qualities within, without compromising the functionality and efficiency of a retail development. Taking cues from nature as a means of creating balance between the more hard edge, urban environment of Shibuya, the simple massing articulation, or gesture mimics the pattern of waves and their undulating movement, with imagery that also evokes the contemplative and soothing gestures of raked brush strokes seen in tranquil rock gardens, evoking a sense of calm and excitement, easily recognisable and yet able to stand apart from the surrounding context. Huge congratulations to Snohetta for their winning design! #3xnarchitects#tokyo#facadedesign #facade#arch_shovel

‘Where’s House Warehouse’ by pbm Architects defies typical warehouse stereotypes with an ethereal design in Bangkok. The architects crafted a multi-use space blending office and storage functions. Its facade, made of glass cuboids, breaks the monotony of industrial contexts. The concept evolved from merging living, working, and storage areas seamlessly, fostering interaction and fluidity. Architecture: PBM Architects Images: Spaceshift Studio 📍Bangkok, Thailand . #facadedesign#glassarchitecture#thaiarchitecture#industrialarchitecture#arch_shovel

Facades for the OPPO Super Flagship Store. Bamboo inspired the facade design for the OPPO Super Flagship Store in the city of Guangzhou. An important source of food, clothing, housing, and transportation for people in Guangzhou in ancient times, the design adds a contemporary twist to the vernacular architecture of the city. Photos: CreatAR images Architecture: UnStudio #unstudio#benvanberkel#materialmonth#architecture#facadedesign#arch_shovel

Do you know how many silver spheres are on the facade of the Hanjie Wanda Square in Wuhan, China? 42,333. While they all may look identical, their specific positions involving each other recreate the effect of movement and reflection in water or the sensuous folds of silk fabric. Photos: Edmon Leong / UNStudio #unstudio#facades#facadedesign#architecture#retaildesign#lightingdesign#arch_shovel

Can you guess what inspired Unstudio architecture’s design for the facade elements of the Shenzhen Maritime Museum? Comment your answer below! #unstudio#ceramicdesign#facadedesign#worldmuseums#museumsoftheworld#museumdesign#architecture#architecturaldesign#arch_shovel