mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Change the event name to SHUTTLE_WILL_ARRIVE_AT_STOP, and emit it before the stop is updated
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user