Time and Weather based Affordances should update more frequently
youralien opened this issue · 1 comments
youralien commented
The whole system currently runs on an event-based model, upon a user's location change.
However, there are cases where situations are changing despite a static location. For example, the weather can change to rainy, despite a user being in the same location. Or time continues to progress, despite a user being in the same location.
youralien commented
This illustrates a new model, where the event-based onLocationUpdate
model is compatible with a more frequent polling-based onTimeElasped
model.
To implement this, I would do the following tasks
- Make the processes for "coordinating users to needs" in a separate function. Currently it occurs in the callback of getAffordancesFromLocation: ,
- Create a polling function on the server side
onTimeElasped
, perhaps on a 5 minute interval. Use functions likesetInterval
. Perhaps, it could iterate through all users in db.Locations - Then make sure "coordinating users to needs" is called for the
onLocationUpdate
and theonTimeElapsed
models (see )