-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure that all inputs are tracked by HTTP event stream (#397)
Adds a buffer for input events so that each time the HTTP server sends an `Inputs` event via the event stream (every 1/30th of a second) it is guaranteed to contain _all_ buttons that have been pressed since the last update. That means that the event does not necessarily report the exact state of the buttons but more of an 'echo'. For example, when using the Spin mode unthrottled, the event will likely report all 4 directional buttons to have been pressed at the same time. But I think that's a good tradeoff between accuracy and performance. I've also changed the previously introduced mechanism to wait for the `work_queue` by using an `Event` to using the built-in `task_done()` and `join()` methods of the queue object. Just found those by accident in the Python docs.
- Loading branch information
Showing
4 changed files
with
29 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters