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
Tweak async iterator algorithms #802
Conversation
index.bs
Outdated
The [=async iterator initialization steps=] for a <code class="idl">SessionManager</code> | ||
async iterator |iterator| are: | ||
|
||
1. Set |iterator|'s current state to "not yet started". |
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.
Should "current state" be xreffed like https://heycam.github.io/webidl/#environment-ready-promise ?
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, that's probably a good idea; I'll push that tweak tomorrow before merging.
c14701b
to
1ca64bd
Compare
@Ms2ger I force-pushed a revised commit. I realized I forgot to actually update the call sites of the algorithm, so the changes were more substantial. In particular I replaced the "state" definition with an "is finished" boolean in the ES binding. As such a new re-review would be appreciated. |
I've also pushed a commit that allows "get the next iteration result" to reject to fix #803, since it was so small. |
Make both the "async iterator initialization steps" and the "get the next iteration result" take two arguments: the instance, and the async iterator. This ends up being more ergonomic than using the "current state" concept.
21fa354
to
0af9c61
Compare
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.
Seems fine
* Export the terms we expect people to use * Highlight the samples as Web IDL * Clean up the description of the initialization steps * Simplify the algorithm for next a bit
0af9c61
to
2d6954b
Compare
Make both the "async iterator initialization steps" and the "get the next iteration result" take two arguments: the instance, and the async iterator. This ends up being more ergonomic than using the "current state" concept.
Preview | Diff