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

Queue tasks for [[state]] changes. #229

Closed
wants to merge 1 commit into from
Closed

Conversation

tobie
Copy link
Member

@tobie tobie commented May 30, 2017

Closes #218.


Preview | Diff

@kenchris
Copy link
Contributor

lgtm

Copy link

@alexshalamov alexshalamov left a 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".

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?

Copy link
Member Author

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".

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?

Copy link
Member Author

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:

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?

@tobie tobie closed this May 31, 2017
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 this pull request may close these issues.

Define tasks for state changes
4 participants