@sgmrt · Post #1692 · 07.04.2023 г., 06:47
[CCL]: If you are at #Promenade, #Bayfront or #MarinaBay, you may take the TEL, DTL, or alternative modes of transport. Free regular bus and free bridging bus services are still available. - SMRT
Hashtags
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
Пребарај: #bayfront
@sgmrt · Post #1692 · 07.04.2023 г., 06:47
[CCL]: If you are at #Promenade, #Bayfront or #MarinaBay, you may take the TEL, DTL, or alternative modes of transport. Free regular bus and free bridging bus services are still available. - SMRT
Hashtags
@sgmrt · Post #1467 · 20.06.2022 г., 05:58
[CCL] UPDATE: Shuttle train service is available #Bayfront & #MarinaBay at Platform B. Passengers are advised to use DTL to continue their journey between #Bayfront and #Promenade. - SMRT
Hashtags
@sgmrt · Post #1466 · 20.06.2022 г., 05:43
[CCL]: Due to a track fault, additional 10 mins travelling time between #Promenade & #MarinaBay. Shuttle train service is available #Bayfront & #MarinaBay at Platform B. Passengers are advised to use DTL to continue their journey between #Bayfront and #Promenade. - SMRT
Hashtags
@sgmrt · Post #1690 · 07.04.2023 г., 06:15
[CCL]: Pls add 40mins of train travel time between #DhobyGhaut/#MarinaBay and #Stadium. Commuters are advised to take other lines such as DTL, NSL and NEL if you are at #DhobyGhaut, #MarinaBay, #Promenade or #Bayfront. Free regular bus and free bus bridging svcs are available. - SMRT
@sgmrt · Post #1740 · 23.06.2023 г., 15:33
[CCL] UPDATE: No train service between #Esplanade / #Bayfront and #Mountbatten. Additional 30 minutes between #DhobyGhaut and #Esplanade, #MarinaBay and #Bayfront, and #Mountbatten and #PayaLebar. Please use alternative means of transport to continue your journey. - SMRT
@sgmrt · Post #1738 · 23.06.2023 г., 14:58
[CCL] UPDATE : No train service between #Esplanade / #Bayfront and #Mountbatten. Additional 30 minutes between #DhobyGhaut and #Esplanade, #MarinaBay and #Bayfront, and #Mountbatten and #PayaLebar. - SMRT
@sgmrt · Post #2469 · 01.09.2025 г., 00:49
[CCL] UPDATE: Passengers travelling towards #MarinaBay, please transfer at #DhobyGhaut or #Bishan for the North-South Line, or #Caldecott for the Thomson-East Coast Line. Passengers travelling towards #Bayfront, please transfer at #Promenade or #MacPherson for the Downtown Line. - SMRT