@sgmrt · Post #2330 · 23.04.2025 г., 01:09
[EWL] CLEARED: Train service between #Tampines and #PasirRis have resumed. Free regular bus service ceased. - 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
Пребарај: #pasirris
@sgmrt · Post #2330 · 23.04.2025 г., 01:09
[EWL] CLEARED: Train service between #Tampines and #PasirRis have resumed. Free regular bus service ceased. - SMRT
@sgmrt · Post #2329 · 23.04.2025 г., 00:59
[EWL] UPDATE: Fault cleared. Train service resumed. Free regular bus service is still available between #Tampines and #PasirRis. - SMRT
@sgmrt · Post #2325 · 23.04.2025 г., 00:09
[EWL] UPDATE: Please add 10 mins train travel time between #Tampines and #PasirRis, in both directions due to track point fault. Free regular bus and shuttle train services are available between #Tampines and #PasirRis. Normal train service is available for the rest of East West - SMRT
@sgmrt · Post #2324 · 22.04.2025 г., 23:44
[EWL] UPDATE: Please add 10 mins train travel time between #Tampines and #PasirRis, in both directions due to track point fault. Free regular bus services are available between #Tampines and #PasirRis. Shuttle train service is also available between #Tampines and #PasirRis. Train - SMRT
@sgmrt · Post #2323 · 22.04.2025 г., 23:29
[EWL]: Pls add an additional 10 mins of travelling time between #Tampines and #PasirRis. The eastbound train will turn around at #Tampines towards westbound. Free regular bus services are available between #Tampines and #PasirRis. Shuttle train service is also available between - SMRT
@sgmrt · Post #2322 · 22.04.2025 г., 23:29
[EWL]: Pls add an additional 10 mins of travelling time between #Tampines and #PasirRis. The eastbound train will turn around at #Tampines towards westbound. Free regular bus services are available between #Tampines and #PasirRis. Shuttle train service is also available between https://bit.ly/4jEYkYR - SMRT
@sgmrt · Post #2321 · 22.04.2025 г., 23:24
[EWL] UPDATE: Train svc is available btwn #Tampines and #PasirRis. Please add 10 mins train travel time from Tampines to Pasir Ris, towards Pasir Ris due to track point fault. Free regular bus service is available between Tampines and Pasir Ris. - SMRT
@sgmrt · Post #2320 · 22.04.2025 г., 22:59
[EWL]: Due to a track point fault, pls add additional 10mins train travel time between #Tampines and #PasirRis. Free regular bus service is available between #Tampines and #PasirRis. - SMRT
@sgmrt · Post #2497 · 16.09.2025 г., 16:54
[EWL] UPDATE: Our station staff are assisting the last bridging bus passengers to transfer to the last train at #TanahMerah towards #PasirRis station. - SMRT
Hashtags
@sgmrt · Post #2421 · 06.08.2025 г., 00:59
[EWL] UPDATE: Due to a track point fault, please add additional 25mins train travelling time from #BoonLay to #BuonaVista towards #PasirRis. Free regular bus and bridging bus services are available between #BoonLay and #BuonaVista. - SMRT
Hashtags
@sgmrt · Post #2415 · 05.08.2025 г., 23:39
[EWL] UPDATE: Due to a track point fault, please add additional 25mins train travelling time from #BoonLay to #BuonaVista towards #PasirRis. Free regular bus & bridging bus services are available between #BoonLay and #BuonaVista. - SMRT
Hashtags
@sgmrt · Post #2413 · 05.08.2025 г., 23:19
[EWL] UPDATE: Due to a track point fault, pls add 25mins train travel time from #BoonLay to #BuonaVista towards #PasirRis. Free regular bus & free bridging bus svcs between #BoonLay and #BuonaVista. - SMRT
Hashtags