@sgmrt · Post #2390 · 19.07.2025 г., 06:49
[BPLRT]: Due to a train fault, trains are moving slower towards #ChoaChuKang on Service A. We are investigating the fault. https://bit.ly/450rFrj - SMRT
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #402 · 22 дек.
Отдельно разберём TaskGroup, который пришел на замену gather в Python 3.11. Ключевые отличия ▫️create_task() возвращает объект asyncio.Task, у которого есть соответствюущие методы управления. То есть у нас больше контроля ▫️это контекстный менеджер, который гарантирует что все таски будут остановлены по выходу из контекста ▫️ошибка автоматически отменяет незавершенные задачи, ▫️except* передает нам ExceptionGroup, в котором каждую ошибку можно обработать отдельно import asyncio import random async def do_it() -> str: if random.random() < 0.1: raise ValueError('Oops') delay = random.uniform(0.5, 1.5) await asyncio.sleep(delay) return delay async def main(): try: async with asyncio.TaskGroup() as tg: for _ in range(10): tasks.append(tg.create_task(do_it())) for t in tasks: print(t.result()) except *ValueError as e: for err in e.exceptions: print(err) asyncio.run(main()) Рекомендую изучить страницу Coroutines and Tasks из документации, где представлено больше интересных примеров и механизмов - таймауты - отмена задач - создание задач из другого потока #async
Hashtags
Пребарај: #choachukang
@sgmrt · Post #2390 · 19.07.2025 г., 06:49
[BPLRT]: Due to a train fault, trains are moving slower towards #ChoaChuKang on Service A. We are investigating the fault. https://bit.ly/450rFrj - SMRT
Hashtags
@sgmrt · Post #1961 · 03.06.2024 г., 12:39
[UPDATE] [NSL] : South bound train service from #ChoaChuKang to #Woodlands has resumed. Free Regular Bus and Bridging Bus have ceased. - SMRT
Hashtags
@sgmrt · Post #1960 · 03.06.2024 г., 12:14
[UPDATE] [NSL] : South bound train service from #ChoaChuKang to #Woodlands has resumed. Free Regular Bus and Bridging Bus Services are still available between #ChoaChuKang and #Woodlands. - SMRT
Hashtags
@sgmrt · Post #1959 · 03.06.2024 г., 11:54
[UPDATE] [NSL]North bound trains from #Woodlands towards #ChoaChuKang is in service. - SMRT
Hashtags
@sgmrt · Post #1958 · 03.06.2024 г., 11:49
[UPDATE] [NSL]Due to traction power fault, there is no South bound train service from #ChoaChuKang to #Woodlands. Free Regular Bus and Bridging Bus Services are available between #ChoaChuKang and #Woodlands, passengers are advised to take alternative lines via [TEL] & [CCL] line. - SMRT
Hashtags
@sgmrt · Post #1617 · 05.02.2023 г., 23:53
[NSL] UPDATE: Fault cleared, train services are progressively being restored. You may still experience crowding at some stations. Free regular bus & free bridging bus services are still available btwn #ChoaChuKang and #Yishun. - SMRT
Hashtags
@sgmrt · Post #1615 · 05.02.2023 г., 23:39
[NSL] UPDATE: Fault cleared, train services are progressively being restored. Pls add 5mins train travel time btwn #Yishun and #ChoaChuKang. Free regular bus & free bridging bus services are still available btwn #ChoaChuKang and #Yishun. - SMRT
Hashtags
@sgmrt · Post #1614 · 05.02.2023 г., 23:23
[NSL] UPDATE: Fault cleared, train services are progressively being restored. Pls add 15mins train travel time btwn #Yishun and #ChoaChuKang. Free regular bus and free bridging bus services are still available btwn #ChoaChuKang and #Yishun. - SMRT
Hashtags
@sgmrt · Post #1613 · 05.02.2023 г., 23:10
[NSL]: UPDATE: Due to a track fault, pls add 25mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus is available btwn #ChoaChuKang and #Yishun. You may take TEL or other alternative lines to city area. - SMRT
Hashtags
@sgmrt · Post #1612 · 05.02.2023 г., 23:10
[NSL]: UPDATE: Due to a track fault, pls add 25mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus and free bridging bus services are available btwn #ChoaChuKang and #Yishun. You may take TEL or other alternative lines to city area. - SMRT
Hashtags
@sgmrt · Post #1611 · 05.02.2023 г., 22:53
[NSL]: UPDATE: Due to a track fault, pls add 15mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus is available btwn #ChoaChuKang and #Yishun. You may also take alternative line to city area. - SMRT
Hashtags
@sgmrt · Post #1610 · 05.02.2023 г., 22:53
[NSL]: UPDATE: Due to a track fault, pls add 15mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus is available btwn #ChoaChuKang and #Yishun. You may take TEL or other alternative lines to city area. - SMRT
Hashtags