At the moment the server sends wait times for every lift back to the client every time the client sends a location update. That's dumb, since most location updates will happen when the user is skiing. We should only send wait times to the client when they actually need them. Not sure about the best way to do this, since it'd also be nice if the data are just there when the user looks for them. But we can definitely do better than what we do at the moment.
Along with the send-data-too-often there's the send-too-much-data. We should be smart about the choice of lifts for which we send data. Maybe we send data for all lifts within n km, maybe the user selects lifts they care about and we only send data for those, maybe something else.
Not sure what you are going for but an Observable might solve this for you.. I am new to Observables so I might be incorrect, this guy explains it pretty well:
https://www.youtube.com/watch?v=R-GzJgEccEQ
Check users location infrequently ~once per minute
(If location = Lift location) { start timer to see how long user has to wait }
Check location more frequently until current (location != lift location) { stop timer }
At the moment the server sends wait times for every lift back to the client every time the client sends a location update. That's dumb, since most location updates will happen when the user is skiing. We should only send wait times to the client when they actually need them. Not sure about the best way to do this, since it'd also be nice if the data are just there when the user looks for them. But we can definitely do better than what we do at the moment.
Along with the send-data-too-often there's the send-too-much-data. We should be smart about the choice of lifts for which we send data. Maybe we send data for all lifts within n km, maybe the user selects lifts they care about and we only send data for those, maybe something else.