-
Notifications
You must be signed in to change notification settings - Fork 56
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
Early design review: scheduler.yield() #827
Comments
Hi, @plinss and I took a look at this during our Tokyo F2F this week. Overall, we like the idea of a simple API a developer can use to yield back to the event loop mid-computation. Here are a few specific things we noticed while reviewing the explainer, and one general worry:
A general concern: In isolation, this seems like a very sensible API. But it's part of a much larger project and it's unclear to us if there has been much external review (especially from other implementors) of the Scheduler API project as a whole. Relatedly, this builds on some other API (e.g. Anyway, this strikes us as a simple and ergonomic way for developers to do something quite common. Please ask us to review the "bigger picture" of the Scheduler API, and we'd love to take a look at |
We're going to close this issue, as Tess asked above, please let us know when the "bigger picture" Scheduler API is ready for review. |
Thanks Peter and Tess for the feedback! I've been actively working on the "bigger picture" explainer -- hoping to have it in a shareable state within ~the next month. |
Hi again, Just to update here as well: I've drafted a "bigger picture" explainer, and I'll file a new issue for that and a spec review for
They are related: Also, note that this mirror's
Good question; I think there are several aspects to this:
Do you mean something like But I'd expect a browser implementation to at least be self-consistent in terms of prioritization (ordering guarantees between yield() and postTask() tasks), support aborting, and truly yield to the event loop. I put together a polyfill having these properties -- but it doesn't implement inheritance, which requires hacking around async/await. |
こんにちは TAG-さん!
I'm requesting a TAG review of
scheduler.yield()
.scheduler.yield()
is an API for yielding control to the browser's event loop, which can be used to break up long tasks. Awaiting the promise returned by scheduler.yield() causes the current task to yield, continuing in a new browser task. This can be used to improve responsiveness issues caused by long tasks. Continuations are prioritized to mitigate performance problems of existing alternatives.Further details:
We'd prefer the TAG provide feedback as (please delete all but the desired option):
🐛 open issues in our GitHub repo for each point of feedback
The text was updated successfully, but these errors were encountered: