@sgmrt · Post #1990 · 04.07.2024 г., 00:09
[EWL] CLEARED: Train svcs from #BoonLay to #Clementi have resumed. Free regular bus & free bridging bus svcs have ended. - SMRT
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
Пребарај: #clementi
@sgmrt · Post #1990 · 04.07.2024 г., 00:09
[EWL] CLEARED: Train svcs from #BoonLay to #Clementi have resumed. Free regular bus & free bridging bus svcs have ended. - SMRT
@sgmrt · Post #1989 · 04.07.2024 г., 00:04
[EWL] UPDATE: Fault on the EWL has cleared, train service has resumed. Free regular bus and bridging bus services are still available between #BoonLay & #Clementi. - SMRT
@sgmrt · Post #1988 · 03.07.2024 г., 23:54
[EWL] UPDATE: Fault on the EWL has cleared, train services are progressively returning to normal speed. Free regular bus & bridging bus services are still available between #BoonLay & #Clementi. - SMRT
@sgmrt · Post #1987 · 03.07.2024 г., 23:54
[EWL] UPDATE: Fault on the EWL has cleared, train services are progressively returning to normal. Free regular bus and bridging bus services are still available between #BoonLay and #Clementi. - SMRT
@sgmrt · Post #2409 · 05.08.2025 г., 22:05
[EWL]: Due to a track point fault, pls add 15mins train travel time from #BoonLay to #Clementi towards #PasirRis. - SMRT
@sgmrt · Post #1985 · 03.07.2024 г., 23:14
[EWL] UPDATE: Due to a track fault, pls add 30mins train travel time from #BoonLay to #Clementi towards #PasirRis. Free regular bus & free bridging bus svcs are available btwn #BoonLay and #Clementi. - SMRT
@sgmrt · Post #1984 · 03.07.2024 г., 23:14
[EWL] UPDATE: Due to a track fault, pls add 20mins train travel time from #BoonLay to #Clementi towards #PasirRis. Free regular bus & bridging bus svcs are available btwn #BoonLay and #Clementi. - SMRT
@sgmrt · Post #1980 · 03.07.2024 г., 22:24
[EWL] UPDATE: Train svc is available from #BoonLay to #Clementi towards #PasirRis. Free regular bus svcs from #BoonLay to #Clementi. Our station staff will assist. - SMRT
@sgmrt · Post #1979 · 03.07.2024 г., 22:24
[EWL]: Due to a track fault, pls add 20mins train travel time from #BuonaVista to #Clementi towards #PasirRis. Free regular bus svcs from #BuonaVista to #Clementi. Our station staff will assist. - SMRT
Hashtags
@sgmrt · Post #1982 · 03.07.2024 г., 22:39
[EWL] UPDATE: Due to a track fault, pls add 20mins train travel time from #BoonLay to #Clementi towards #PasirRis. Free regular bus svcs btwn #BoonLay and #Clementi. Passengers travelling towards city area, please and take North South Line towards #AngMoKio and #MarinaSouthPier. - SMRT
@sgmrt · Post #1981 · 03.07.2024 г., 22:34
[EWL]: UPDATE: Due to a track fault, pls add 20mins train travel time from #BoonLay to #Clementi towards #PasirRis. Free regular bus svcs from #BoonLay to #Clementi. Passengers travelling towards city area, please take North South Line towards #AngMoKio and #MarinaSouthPier. - SMRT
@sgmrt · Post #2293 · 04.04.2025 г., 05:34
[EWL]: Due to a track fault, please expect an additional 20mins of travelling time between #Queenstown and #BoonLay. Shuttle train are available between #Clementi and #JurongEast and #JurongEast and #Lakeside. Free regular bus is available between #BuonaVista and #BoonLay. - SMRT