-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Make all agent allocation imperative #5411
Conversation
62f035c
to
6c11764
Compare
This adds a specific definition for "an agent's event loop", as opposed to "event loop" generally, and uses it where appropriate. In a few cases, this involves moving from "object's event loop" to "object's relevant agent's event loop". Note that for worker agents, event loop creation and association with the agent is explicit. For window agents there is no corresponding text. This can be settled as part of #5411.
#5416 should land before this, and then after it does, this PR should be updated to explicitly create event loops and associate them with agents at agent creation time. |
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.
This looks really great to me. And we got all the way here without help from upstream. Hopefully this can help inform that discussion a bit when it eventually comes.
|
||
<div w-nodev> | ||
|
||
<p>To <dfn>create an agent</dfn>, given a boolean <var>canBlock</var>:</p> |
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.
I think this is fine, but I do wonder about the relationship with agent clusters. I guess we'll just wait for JavaScript to organize that?
This adds a specific definition for "an agent's event loop", as opposed to "event loop" generally, and uses it where appropriate. In a few cases, this involves moving from "object's event loop" to "object's relevant agent's event loop". Note that for worker agents, event loop creation and association with the agent is explicit. For window agents there is no corresponding text. This can be settled as part of #5411.
This adds a specific definition for "an agent's event loop", as opposed to "event loop" generally, and uses it where appropriate. In a few cases, this involves moving from "object's event loop" to "object's relevant agent's event loop". Note that for worker agents, event loop creation and association with the agent is explicit. For window agents there is no corresponding text. This can be settled as part of #5411.
Closes #5210. Closes #4339 by removing the explicit phrasing of a parallel execution environment, instead relying on the agent infrastructure. Closes #4988 by reintroducing a definition for "similar-origin window agent", separate from its creation algorithm. Like the definition of all agent types, it is now informal, just stating what globals are contained in the agent. Relocates the site-related definitions to the "Origin" section of the spec, adjacent to the "schemelessly same site" and "same site" definitions. Exposes some of the higher-level concepts here to the dev edition.
3924e32
to
fdebd6b
Compare
Ready for re-review. Thanks for the suggestions; your version of obtain a worker/worklet agent is much better. |
Follows whatwg/html#5411. Also includes a top-level origin, introduced in whatwg/html#4966.
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.
This is great, thanks! (One question, but okay either way I think.)
agent">obtaining a dedicated/shared worker agent</span> given <var>outside settings</var> and | ||
<var>is shared</var>. Run the rest of these steps in that agent.</p> | ||
|
||
<p id="worker-processing-model-top">For the purposes of timing APIs, this is the <dfn |
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.
Why move this id inward?
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.
I can't really figure out what this is used for; neither the HTML spec itself, nor https://w3c.github.io/hr-time/, references it. So I guessed that it might be best used for something that wanted to link to "when we enter a parallel thread", which now aligns with this step. Otherwise one would just link to "run a worker" directly.
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.
935599c and https://www.w3.org/Bugs/Public/show_bug.cgi?id=21725 suggest we could remove it.
Follows whatwg/html#5411. Also includes a top-level origin, introduced in whatwg/html#4966.
* Update agent and realm allocation Follows whatwg/html#5411. * Update docs/index.bs * Update docs/index.bs * agent/event loop * Event loop and other ESO fixes Co-authored-by: Jake Archibald <[email protected]>
Closes #5210.
Closes #4339 by removing the explicit phrasing of a parallel execution
environment, instead relying on the agent infrastructure.
Closes #4988 by reintroducing a definition for "similar-origin window
agent", separate from its creation algorithm. Like the definition of all
agent types, it is now informal, just stating what globals are contained
in the agent.
Relocates the site-related definitions to the "Origin" section of the
spec, adjacent to the "schemelessly same site" and "same site"
definitions.
Exposes some of the higher-level concepts here to the dev edition.
This will require changes to the service worker and worklet specs to use the new concepts; stay tuned for some PRs there.
I could have factored out the movement of the site stuff into a separate commit; let me know if that'd be preferable.
/browsers.html ( diff )
/browsing-the-web.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/origin.html ( diff )
/webappapis.html ( diff )
/window-object.html ( diff )
/workers.html ( diff )