[ServiceWorker] MessageEvent within the SW global should have waitUntil() (#669)

Not sure how to easily mix this in, but the SW should be able to signal it's doing work after a `postMessage`

```js
self.onmessage = function(event) {
  event.waitUntil(
    doAsyncStuff.then(response => event.source.postMessage(response))
  )
};
```

Or we could revisit a global waitUntil https://github.com/slightlyoff/ServiceWorker/issues/400. We'd need to call it something different though, I'm worried devs may use `waitUntil()` instead of `event.waitUntil()` and get different behaviour because success/failure doesn't reach the event dispatcher.

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

Received on Wednesday, 1 April 2015 16:04:09 UTC