[ServiceWorker] Equivalent of Shared Worker Port in Service Worker? (#662)

Shared Worker uses Message Port to send messages between parent worker and Shared Worker.

**Parent worker**
```
var port = new SharedWorker('/worker.js').port;
port.onmessage = function(e){
    console.log(e.data);
};
port.start();
port.postMessage("Hello Shared Worker. I'm Mr. Tab");
```
**Shared Worker (worker.js)**
```
onconnect = function(e){
    var port = e.ports[0];
    port.onmessage = function(e){
        console.log(e.data);
    };
    port.start();
    port.postMessage("Hello Mr. Tab. I'm Shared Worker.");
};
```
Is there anything similar to Shared Worker Port in Service Worker?

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

Received on Tuesday, 24 March 2015 11:25:04 UTC