Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time and Weather based Affordances should update more frequently #133

Open
youralien opened this issue May 22, 2021 · 1 comment · May be fixed by #140
Open

Time and Weather based Affordances should update more frequently #133

youralien opened this issue May 22, 2021 · 1 comment · May be fixed by #140

Comments

@youralien
Copy link
Member

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
Copy link
Member Author

youralien commented May 22, 2021

image
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:
    getAffordancesFromLocation(uid, location, retrievePlaces, function (uid, bgLocationObject, affordances) {
    ,
  • Create a polling function on the server side onTimeElasped, perhaps on a 5 minute interval. Use functions like setInterval. Perhaps, it could iterate through all users in db.Locations
  • Then make sure "coordinating users to needs" is called for the onLocationUpdate and the onTimeElapsed models (see
    decomissionFromAssignmentsIfAppropriate(uid, sharedAffs);
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant