Nov 6, 2008, в 2:18 AM, Jonas Sicking написал(а):

Similarly, having separate interfaces for Worker and SharedWorker implies that there is some fundamental difference in their behavior - a difference that eludes me so far.

A shared worker is shared between all scripts on a single site[*] that instantiates a worker with the same name. I.e. where the second argument to the constructor is the same. (Don't remember what happens if the second argument is the same as an existing worker, but the first is not, check with the spec).


Sure, that part is clear - but it's only about the behavior of the object's constructor, not the object itself! It alone doesn't warrant having a separate interface.

As an example from another area, see mmap(2) function - you can pass MAP_ANON or MAP_FILE via its flags to achieve similar results. Note also that it has a number of other options. If we create a separate interface for every Worker isolation level needed (both inside and outside), we'll soon end up with PrivateWorker, SharedDataWorker and who knows what else.

- WBR, Alexey Proskuryakov

Reply via email to