<div class="gmail_quote">I agree. Moreover, since a shared worker identified by a given name cannot be "navigated" elsewhere, the name isn't all that synonymous with other usages of names (e.g., window.open). At the very least, it would seem helpful to scope the name to the URL to avoid the name conflict issue.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">-Darin</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">
On Mon, Aug 17, 2009 at 3:53 PM, Michael Nordman <span dir="ltr"><<a href="mailto:michaeln@google.com">michaeln@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
What purpose the the 'name' serve? Just seems uncessary to have the notion of 'named' workers. They need to be identified. The url, including the fragment part, could serve that purpse just fine without a seperate 'name'. <div>
<div><br></div><div>The 'name' is not enough to identify the worker, <url,name> is the identifier. Can the 'name' be used independently of the 'url' in any way?</div><div><br></div><div>* From within a shared worker context, it is exposed in the global scope. This could inform the work about what 'mode' to run. The location including the fragment is also exposed within a shared worker context, the fragment part could just as well serve this 'modalility' purpose.</div>
<div><br></div><div>* From the outside, it has to be provided as part of the identifier to create or connect to an shared worker. And there are awkward error conditions arising when a worker with 'name' already exists for a different 'url'. The awkward error conditions would be eliminated if <id> == <url>.</div>
<div><br></div><div>* Is 'name' visible to the web developer any place besides those two?</div><div><div></div><div class="h5"><div><br></div><div><br></div><div>On Mon, Aug 17, 2009 at 2:44 PM, Mike Shaver <span dir="ltr"><<a href="mailto:mike.shaver@gmail.com" target="_blank">mike.shaver@gmail.com</a>></span> wrote:</div>
<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Sat, Aug 15, 2009 at 8:29 PM, Jim Jewett<<a href="mailto:jimjjewett@gmail.com" target="_blank">jimjjewett@gmail.com</a>> wrote:<br>
</div><div><div></div><div>>> Currently, SharedWorkers accept both a "url" parameter and a "name"<br>
>> parameter - the purpose is to let pages run multiple SharedWorkers using the<br>
>> same script resource without having to load separate resources from the<br>
>> server.<br>
><br>
>> [ request that name be scoped to the URL, rather than the entire origin,<br>
>> because not all parts of <a href="http://example.com" target="_blank">example.com</a> can easily co-ordinate.]<br>
><br>
> Would there be a problem with using URL fragments to distinguish the workers?<br>
><br>
> Instead of:<br>
> new SharedWorker("url.js", "name");<br>
><br>
> Use<br>
> new SharedWorker("url.js#name");<br>
> and if you want a duplicate, call it<br>
> new SharedWorker("url.js#name2");<br>
><br>
> The normal semantics of fragments should prevent the repeated server fetch.<br>
<br>
</div></div>I don't think that it's very natural for the name to be derived from<br>
the URL that way. Ignoring that we're not really identifying a<br>
fragment, it seems much less self-documenting than a name parameter.<br>
I would certainly expect, from reading that syntax, for the #part to<br>
be calling out a sub-script (property or function or some such) rather<br>
than changing how the SharedWorker referencing it is named!<br>
<font color="#888888"><br>
Mike<br>
</font></blockquote></div><br></div></div></div></div>
</blockquote></div><br>