Re: [w3c/ServiceWorker] Improve handling of extend lifetime promises (#1049)

jungkees commented on this pull request.



>        The user agent *should not* <a lt="terminate service worker">terminate</a> the [=/service worker=] associated with |event|'s <a>relevant settings object</a>'s [=environment settings object/global object=] until |event|'s <a>extensions allowed flag</a> is unset. However, the user agent *may* impose a time limit to this lifetime extension.
   </section>
 
   <section algorithm>
+    <h3 id="handle-extend-lifetime-promise-algorithm"><dfn>Handle Extend Lifetime Promise</dfn></h3>
+
+      : Input
+      :: |event|, an {{ExtendableEvent}} object
+      :: |promise|, a [=promise=]
+      : Output
+      :: None
+
+      1. Wait until |promise| is settled [=in parallel=].
+      2. [=Queue a microtask=] to run the following substeps:

This should be queued from the task where the promise is settled. I explicitly used promise’s relevant settings object's responsible event loop to queue this microtask.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1049

Received on Monday, 9 January 2017 10:05:57 UTC