[whatwg] workers

2008/9/30 Alexey Proskuryakov <ap at webkit.org>:
> Sep 24, 2008, ? 10:38 PM, Aaron Boodman ???????(?):
>
>> interface DedicatedWorker : Worker {
>
> I've been trying to understand the difference between SharedWorker and
> DedicatedWorker interfaces. Besides the ability to pick an existing worker
> by name, are there any other semantic differences? I may be missing
> something, but it looks like a single Worker interface with an optional name
> parameter to constructor would work just as well.

That is what we are debating here. Logically, there is a concept of a
"shared worker", which can be referenced from multiple pages in the
same origin. There is a debate about how much the interface between
shared workers and dedicated workers should be different.

I'm of the opinion that there should be as little difference as
possible, to lower the amount of API to learn. Therefore in my
preferred proposal, the only difference between SharedWorker and
DedicatedWorker is that the latter has a close() method. It doesn't
make sense to allow one user of a SharedWorker to close something
others are depending on.

Jonas is in favor of making a particular use case of DedicatedWorker
as simple to use as possible. This requires extra API on
DedicatedWorker that doesn't make sense for SharedWorker.

>> void sendMessage(String message);
>
> The WHATWG draft calls this postMessage() - is this just a different name,
> or an implied substantial difference in behavior?

No that was a mistake on my part. It should be called postMessage.

- a

Received on Tuesday, 30 September 2008 08:19:22 UTC