Join GitHub today
Define tasks for state changes #218
According to recommendations from Anne state changes should be performed from task.
Also, spec must define what happens to tasks that are in the queue, e.g., whether those can be cancelled (removed from queue).
Sensor is active and update reading is queued, then error occurs and page loses visibility.
Should we process queue and don’t allow new tasks to be added from sensor? Should we 'suspend' tasks and wait when page gains visibility and then process tasks?
Sensor is is active, update sensor reading scheduled, then stop is called.
Two tasks in queue [update sensor reading, change state to idle]
Page looses visibility is not going to queue anything afaik.
Not sure what you mean by that, but the sensor can continue adding new tasks (for example if it's re-started).
No, they're queued and can be processed right away.
Alright, so I checked with Anne and that was an excessive interpretation of his words.
Still checking to see if/when to apply it to events, as that part is still unclear to me.
Anne was right, we should update states + fire event from tasks when we get some async events, e.g., from platform.
Due to single threaded nature of JS for things like start / stop, we are executing code in same call-chain, so, this issue might not be applicable.
For things that run 'in parallel', we need to queue new tasks.
…d internal slots used in the Sensor interface specification. The refactoring goals are: 1) Stop firing events synchronously. 2) Clean up the internal slots after stop or error. 3) Fix logical errors in the abstract operations. 3) Recompose abstract operations so that duplication of the algorithms steps is removed. 4) Drop the unused abstract operations and internal slots. Fixes w3c#199 Fixes w3c#200 Fixes w3c#201 Fixes w3c#203 Fixes w3c#218 Fixes w3c#215 Fixes w3c#204
…d internal slots used in the Sensor interface specification. The refactoring goals are: - Stop firing events synchronously. - Reset internal slots values after stop. - Fix logical errors in the abstract operations. - Recompose abstract operations so that duplication of the algorithms steps is removed. - Drop the unused abstract operations and internal slots. Fixes w3c#203 Fixes w3c#218 Fixes w3c#215 Fixes w3c#204 Fixes w3c#126 Fixes w3c#243