{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/html/issues/411","repository_url":"https://api.github.com/repos/whatwg/html","labels_url":"https://api.github.com/repos/whatwg/html/issues/411/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/html/issues/411/comments","events_url":"https://api.github.com/repos/whatwg/html/issues/411/events","html_url":"https://github.com/whatwg/html/issues/411","id":122494699,"number":411,"title":"Allow workers & shared workers to be created within a service worker","user":{"login":"jakearchibald","id":93594,"avatar_url":"https://avatars2.githubusercontent.com/u/93594?v=3","gravatar_id":"","url":"https://api.github.com/users/jakearchibald","html_url":"https://github.com/jakearchibald","followers_url":"https://api.github.com/users/jakearchibald/followers","following_url":"https://api.github.com/users/jakearchibald/following{/other_user}","gists_url":"https://api.github.com/users/jakearchibald/gists{/gist_id}","starred_url":"https://api.github.com/users/jakearchibald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakearchibald/subscriptions","organizations_url":"https://api.github.com/users/jakearchibald/orgs","repos_url":"https://api.github.com/users/jakearchibald/repos","events_url":"https://api.github.com/users/jakearchibald/events{/privacy}","received_events_url":"https://api.github.com/users/jakearchibald/received_events","type":"User","site_admin":false},"labels":[{"id":257427609,"url":"https://api.github.com/repos/whatwg/html/labels/needs%20implementor%20interest","name":"needs implementor interest","color":"5319e7","default":false},{"id":382843348,"url":"https://api.github.com/repos/whatwg/html/labels/topic:%20workers","name":"topic: workers","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2015-12-16T12:33:39Z","updated_at":"2017-04-14T13:39:13Z","closed_at":null,"body":"At the moment, a (shared)worker's lifecycle is linked to [related documents](https://html.spec.whatwg.org/multipage/workers.html#active-needed-worker), but these should be creatable within a service worker to do things such as image processing, expensive diffing etc without locking up the service worker.\n\nI imagine this means changing [the worker's documents](https://html.spec.whatwg.org/multipage/workers.html#the-worker's-documents) to be the worker's clients, where clients can be documents or service workers.\n\nPrevious discussion https://github.com/slightlyoff/ServiceWorker/issues/678\n"},"comment":{"url":"https://api.github.com/repos/whatwg/html/issues/comments/294155086","html_url":"https://github.com/whatwg/html/issues/411#issuecomment-294155086","issue_url":"https://api.github.com/repos/whatwg/html/issues/411","id":294155086,"user":{"login":"wanderview","id":1256526,"avatar_url":"https://avatars1.githubusercontent.com/u/1256526?v=3","gravatar_id":"","url":"https://api.github.com/users/wanderview","html_url":"https://github.com/wanderview","followers_url":"https://api.github.com/users/wanderview/followers","following_url":"https://api.github.com/users/wanderview/following{/other_user}","gists_url":"https://api.github.com/users/wanderview/gists{/gist_id}","starred_url":"https://api.github.com/users/wanderview/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanderview/subscriptions","organizations_url":"https://api.github.com/users/wanderview/orgs","repos_url":"https://api.github.com/users/wanderview/repos","events_url":"https://api.github.com/users/wanderview/events{/privacy}","received_events_url":"https://api.github.com/users/wanderview/received_events","type":"User","site_admin":false},"created_at":"2017-04-14T13:39:13Z","updated_at":"2017-04-14T13:39:13Z","body":"One thing to think about when this is spec'd and implemented:\r\n\r\n1. Service Worker foo creates a nested worker bar\r\n2. bar's URL is covered by foo's scope and becomes controlled by foo\r\n3. bar periodically issues fetch() requests triggering fetch events in foo keeping foo alive\r\n\r\nIt seems we would need to do the same propagation of lifetime budget for nested workers that we do for self-postmessage.  The fetch events from a nested worker solely owned by the service worker should not grant new lifetime budget to that service worker.\r\n\r\nAs an added wrinkle, a shared worker could transition from being solely owned by the service worker to being shared with a window and back again.\r\n\r\nShould be fun to implement and test."}}
{"actor":{"display_login":"wanderview"}}