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

Modify 'haveGottenOthers' and 'startTick' events to throttle tick update rate to server #40

Open
bushidocodes opened this issue Feb 5, 2017 · 2 comments

Comments

@bushidocodes
Copy link
Contributor

It looks like these two events form an extra hop to the server and back. I believe that @bethqiang explained that @leafoflegend suggested that this get put in as a means to have a hook to throttle client updates.

Some things that would need to happen to make this feasible:

  • The server should have a config reducer to store a 'tickRate' and any other general parameters
  • The thunk action creator would probably be similar to removeUserAndEmit. It would set the tick rate and then broadcast the rate out to all connected clients via startTick (maybe renamed to setTickRate)
  • The setTickRate event may update the local Redux store on the client
  • The redux store might also need a 'tick counter' to keep track of the number of ticks that have gone by (e.g. I'm set to emit every 3rd tick, and this is my second tick since my last emit).
  • The publish-location A-Frame component might check the redux store tick rate or tick iterator and emit based on that.
@bushidocodes
Copy link
Contributor Author

It might also be neccessary to group these ticks into "batches" to make sure the throttling effects a meaningful reduction of server --> client updates.

@bushidocodes
Copy link
Contributor Author

Based on Slack discussions with @Jmikeydarby , it sounds like this is probably not something worth investigating. A possible time to revisit would be when server load becomes a meaningful bottleneck.

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

No branches or pull requests

1 participant