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

ServiceWorker: support queueing tasks from SW manager #26360

Open
gterzian opened this issue Apr 30, 2020 · 0 comments
Open

ServiceWorker: support queueing tasks from SW manager #26360

gterzian opened this issue Apr 30, 2020 · 0 comments

Comments

@gterzian
Copy link
Member

@gterzian gterzian commented Apr 30, 2020

#26317 moves the "job queue" concept over IPC, and runs the various algorithms of the job queue "in parallel" on the SW manager, so that various data can be made unique per UA, and manipulated atomically.

The spec at various points in job queues algorithms writes to "queue a task" back on the event-loop of the client of the workers(so not on the event-loop where the ServiceWorkerGlobalScope is running, rather the event-loop where the various DOM interfaces like ServiceWorker are being used).

Example:

Also note that this is different from resolving or rejecting the promise related to the job, which is something for which infra is being introduced in #26317

So essentially, I think we need something similar to what was done with MessagePort and BroadcastChannel, where a GlobalScope would, when first starting to "use" a related DOM object, setup some local data and an IPC route, and communicate via the constellation to the releavant SW manager, so that the SW manager can queue tasks on the event-loop of the global when necessary.

See for example what is being done at

pub fn track_message_port(&self, dom_port: &MessagePort, port_impl: Option<MessagePortImpl>) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.