Re: [ServiceWorker] Worker-As-A-Service service workers (#744)

Foreign fetch would definitely be (part of) a solution for a BPG-decoding-as-a-service shared service worker. A service worker on some particular origin that does the recoding when it receives a fetch.
So yes, I agree that foreign fetch is a good first-pass at a solution for "worker-as-a-service" service workers. And versioning would hopefully not be much of a problem there, since dependencies would pretty much be one-way only.

But that also exposes the problem that now all BPG-decoding requests from all websites run through a single single-threaded service workers. With no ability for service workers to spin up shared and/or dedicated workers, such a service worker can really only process one request at a time.

So I guess my answer indeed misread the original question, and I was more answering the "how could service workers deal with having multiple threads of execution". For that question that maybe wasn't asked, existing postMessage between cooperating same-origin service workers could be one part of the answer; maybe workers that are tied to the lifetime of a FetchEvent (for the BPG decoding example), and/or workers that are tied to the lifetime of a notification-with-progress-bar could be another part for more long running background tasks a service worker might want to perform.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/744#issuecomment-140892158

Received on Wednesday, 16 September 2015 20:57:14 UTC