Re: [ServiceWorker] Client.postMessage should return a Promise (#677)

I used `postMessage` in many ways for various [multi-screen projects and experimentations](https://www.youtube.com/watch?v=-o8B4TE18gI) : `window.open`, SharedWorker, BroadcastChannel, manual MessageChannel ports... It always felt like UDP to me and when I needed some kind of "TCP ACK", I had to build it myself.

I would prefer the `postMessage` API to behave the same as the rest of the platform. I see three possibilities :

1. Make SW `postMessage` return a promise and update other specs (there's a lot of them) to behave the same way.
2. Use a different function name in SW and this one would return a promise. IIRC, the presentation API renamed postMessage to something more like the WebRTC API.
3. Just do nothing. Stay low level and let devs build stuffs [like this](https://github.com/bevacqua/swivel).

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

Received on Monday, 2 November 2015 10:27:13 UTC