[w3c/webpayments-payment-apps-api] Communication between JS PaymentApps and the User Agent (#26)

I've read through @adamroach's new [proposal](https://github.com/w3c/webpayments-payment-apps-api/blob/gh-pages/proposals/jsapi.md), which I think looks very promising. Making it a Worker definitely feels like the right approach to me.

According to the proposal, communication with the user agent is done through a `MessageChannel`. This is slightly different from how communication with the user agent is done in other workers (see [here](https://www.w3.org/TR/workers/#communicating-with-a-dedicated-worker) or [here](https://developers.google.com/web/fundamentals/getting-started/push-notifications/step-03?hl=en#add-event-listeners-to-your-service-worker)), which typically use `addEventListener` to set up communication.

Is there an advantage to using `MessageChannel` with `port1` for receiving messages and `port2` for passing messages back to the user agent? If there is no clear advantage, should we try to align this with the way serviceworkers and other workers are implemented?

-- 
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/webpayments-payment-apps-api/issues/26

Received on Monday, 15 August 2016 13:06:47 UTC