From b378b22dd9a9fb2cc0b97da76eaf28401003681a Mon Sep 17 00:00:00 2001 From: Jungkee Song Date: Fri, 17 Nov 2017 18:44:03 +0900 Subject: [PATCH] Introduce a parallel queue for running Jobs This change defines a parallel queue called the service worker manager where the instances of Run Job steps are queued and run in order. Fixes #1224. --- docs/index.bs | 18 +++++++++++++----- docs/v1/index.bs | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 82a27beb..e8cfe0da 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -257,6 +257,14 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe Note: A user agent may use a separate task source for each functional event type in order to avoid a head-of-line blocking phenomenon for certain functional events. +
+

User Agent Boot up

+ + A user agent has an associated service worker manager. + + A user agent *must* [=start a new parallel queue=] when it boots up and set the [=service worker manager=] to the result value. +
+

User Agent Shutdown

@@ -2223,15 +2231,15 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe : Output :: none - 1. Assert: |jobQueue| [=queue/is not empty=]. - 1. [=Queue a task=] to run these steps: + 1. [=Enqueue the following steps=] to the [=service worker manager=]: + 1. Assert: |jobQueue| [=queue/is not empty=]. 1. Let |job| be the first [=queue/item=] in |jobQueue|. - 1. If |job|'s [=job type=] is *register*, run [=Register=] with |job| [=in parallel=]. - 1. Else if |job|'s [=job type=] is *update*, run [=Update=] with |job| [=in parallel=]. + 1. If |job|'s [=job type=] is *register*, run [=Register=] with |job|. + 1. Else if |job|'s [=job type=] is *update*, run [=Update=] with |job|. Note: For a register job and an update job, the user agent delays queuing a task for running the job until after a {{Document/DOMContentLoaded}} event has been dispatched to the document that initiated the job. - 1. Else if |job|'s [=job type=] is *unregister*, run [=Unregister=] with |job| [=in parallel=]. + 1. Else if |job|'s [=job type=] is *unregister*, run [=Unregister=] with |job|.
diff --git a/docs/v1/index.bs b/docs/v1/index.bs index d979e400..3e65cbcb 100644 --- a/docs/v1/index.bs +++ b/docs/v1/index.bs @@ -246,6 +246,14 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe Note: A user agent may use a separate task source for each functional event type in order to avoid a head-of-line blocking phenomenon for certain functional events.
+
+

User Agent Boot up

+ + A user agent has an associated service worker manager. + + A user agent *must* [=start a new parallel queue=] when it boots up and set the [=service worker manager=] to the result value. +
+

User Agent Shutdown

@@ -2143,15 +2151,15 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe : Output :: none - 1. Assert: |jobQueue| [=queue/is not empty=]. - 1. [=Queue a task=] to run these steps: + 1. [=Enqueue the following steps=] to the [=service worker manager=]: + 1. Assert: |jobQueue| [=queue/is not empty=]. 1. Let |job| be the first [=queue/item=] in |jobQueue|. - 1. If |job|'s [=job type=] is *register*, run [=Register=] with |job| [=in parallel=]. - 1. Else if |job|'s [=job type=] is *update*, run [=Update=] with |job| [=in parallel=]. + 1. If |job|'s [=job type=] is *register*, run [=Register=] with |job|. + 1. Else if |job|'s [=job type=] is *update*, run [=Update=] with |job|. Note: For a register job and an update job, the user agent delays queuing a task for running the job until after a {{Document/DOMContentLoaded}} event has been dispatched to the document that initiated the job. - 1. Else if |job|'s [=job type=] is *unregister*, run [=Unregister=] with |job| [=in parallel=]. + 1. Else if |job|'s [=job type=] is *unregister*, run [=Unregister=] with |job|.