[whatwg] Combining the DedicatedWorker and SharedWorker interfaces

Ian Hickson wrote:
>> * Remove the port property from the SharedWorker interface and give it
>> a postMessage and onmessage just like dedicated workers have.
> 
> I really don't like this. With (Dedicated)Worker it makes sense because 
> both sides bury the underlying message channel and ports and so things 
> like closing the port, or whether the port is active, are hidden on both 
> sides. But with SharedWorker, if we only bury it on one side, there is a 
> lack of symmetry that IMHO is going to lead to all kinds of issues and 
> confusion. I really don't like that. If people start sending one side's 
> pipe down another channel, we can end up with a situation where a 
> SharedWorker object really represents a port that has nothing to do with 
> the worker anymore.

It's not really that different from what you have today where a 
myWorker.port object can send messages to something that isn't a worker 
at all.

It also removes the issue where the .port property on a shared worker is 
readonly but dead.

/ Jonas

Received on Wednesday, 5 November 2008 15:19:48 UTC