-
Notifications
You must be signed in to change notification settings - Fork 59
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
Queue tasks for [[state]] changes. #229
Conversation
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments.
@@ -907,7 +908,7 @@ The getter of the {{Sensor/timestamp!!attribute}} attribute returns | |||
The {{Sensor/stop()}} method must run these steps: | |||
|
|||
1. If |sensor_instance|.{{[[state]]}} is "idle", then return. | |||
1. Set |sensor_instance|.{{[[state]]}} to "idle". | |||
1. [=Queue a task=] to set |sensor_instance|.{{[[state]]}} to "idle". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to start(), looks like invocations would queue multiple state change tasks + invoke unregister sensor object multiple times, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue.
1. Set |sensor_instance|.{{[[state]]}} to "activating". | ||
1. If |sensor_state| is either "activating" or "activated", | ||
then return. | ||
1. [=Queue a task=] to set |sensor_instance|.{{[[state]]}} to "activating". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The state is not yet 'activating', thus, consecutive start() invocations will queue multiple state change tasks + invoke register sensor multiple times. @pozdnyakov?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right. That doesn't work.
1. Set |sensor_instance|.{{[[state]]}} to "idle". | ||
1. [=Fire an event=] named "error" at |sensor_instance| using {{SensorErrorEvent}} | ||
with its {{SensorErrorEvent/error!!attribute}} attribute initialized to |error|. | ||
1. [=Queue a task=] to run these steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about 'unregister' and resetting internal slots? Do we have issue for that?
Closes #218.
Preview | Diff