Change the event name to SHUTTLE_WILL_ARRIVE_AT_STOP, and emit it before the stop is updated

This commit is contained in:
2025-11-11 19:10:13 -08:00
parent b9fefcc6a9
commit 9af50ddfe9
5 changed files with 12 additions and 11 deletions

View File

@@ -26,12 +26,12 @@ export class RedisSelfUpdatingETARepository extends BaseRedisETARepository imple
startListeningForUpdates() {
this.shuttleRepository.addListener(ShuttleRepositoryEvent.SHUTTLE_UPDATED, this.handleShuttleUpdate);
this.shuttleRepository.addListener(ShuttleRepositoryEvent.SHUTTLE_ARRIVED_AT_STOP, this.handleShuttleArriveAtStop)
this.shuttleRepository.addListener(ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP, this.handleShuttleArriveAtStop)
}
stopListeningForUpdates() {
this.shuttleRepository.removeListener(ShuttleRepositoryEvent.SHUTTLE_UPDATED, this.handleShuttleUpdate);
this.shuttleRepository.removeListener(ShuttleRepositoryEvent.SHUTTLE_ARRIVED_AT_STOP, this.handleShuttleArriveAtStop);
this.shuttleRepository.removeListener(ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP, this.handleShuttleArriveAtStop);
}
private handleShuttleUpdate(shuttle: IShuttle) {
@@ -40,5 +40,6 @@ export class RedisSelfUpdatingETARepository extends BaseRedisETARepository imple
private handleShuttleArriveAtStop(shuttleArrival: ShuttleStopArrival) {
// TODO: handle shuttle arrive at stop
}
}