[whatwg] Workers

David Levin levin at google.com
Thu Nov 13 00:12:35 PST 2008


On Wed, Nov 12, 2008 at 3:35 PM, Ian Hickson <ian at hixie.ch> wrote:

>
> (cc'ed whatwg -- sorry if that wasn't what you intended)
>
> On Wed, 27 Aug 2008, Michael Nordman wrote:
>
> > > > Is it possible for a worker (shared or dedicated) to reload itself?
> > >
> > > Not currently.
> >
> > For dedicated workers, this can effectively be accomplished already by
> > one of the two means of close()ing a worker and then starting a new one
> > and then handing out ports as needed.
> >
> > But for shared workers, this is a more interesting question. Provided
> > clients of the shared worker (those that have a reference to it) can be
> > relied on to restart it upon onclose(), reload() would effectively
> > happen. Are there any windows of time where a shared worker executes w/o
> > a client having a reference it?
>
> Yes. Any worker can survive, e.g. if it has timers running, until its
> parent window (or any window that it ever spoke to) closes the document
> it is associated with.
>
> I don't really see the use case for self-reloading. Do scripts self-reload
> in general?
>

For people who want to update script in SharedWorker, could they do it by
making the SharedWorker merely a shell?

The SharedWorker would create a Worker to do everything.  If a reload is
needed, then the SharedWorker closes the Worker and starts it again (just
like the dedicated worker method described above).

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081113/7f4d608f/attachment-0001.htm>


More information about the whatwg mailing list