[html5] Web Workers: terminate() and XMLHttpRequest

Tobias Sauerwein tobias.sauerwein at camptocamp.com
Wed Jul 28 02:00:46 PDT 2010

Ok, thanks for your explanation!

I am having a problem with Chrome that is somewhat connected to my original
question. It is not about aborting a XMLHttpRequest, but about loading large
files in a web worker and passing the (parsed) content to the main script:

On Tue, Jul 27, 2010 at 8:40 PM, Dmitry Titov <dimich at chromium.org> wrote:

> That would be a bug in the browser. Just as when a regular page is simply
> closed, the termination of the worker releases the resources kept by the
> worker, including XmlHttpRequests, Databases, etc. So yes, in this sense the
> XHR is closed properly.
> On Mon, Jul 26, 2010 at 11:47 PM, Tobias Sauerwein <
> tobias.sauerwein at camptocamp.com> wrote:
>> XMLHttpRequest has a "abort()" method [1], so maybe whatever this method
>> does "closes the request properly"? I was just worried that the connection
>> stays open after the web worker is terminated, and then after a while a kind
>> of "max. open connections" limit is reached, so that I won't be able to make
>> a new request. I don't know if there is such a limit.
>> [1]: http://www.w3.org/TR/XMLHttpRequest/#the-abort-method
>> On Mon, Jul 26, 2010 at 9:15 PM, Dmitry Titov <dimich at chromium.org>wrote:
>>> What is "closed properly"? As far as implementation goes, Chromium for
>>> example will drop the request at some point, asynchronously but quite close
>>> to termination and discard any results, so it can be at any phase of
>>> completion. A mechanism with more guarantees would definitely require an
>>> explicit  spec language.
>>> On Thu, Jul 22, 2010 at 7:11 AM, Tobias Sauerwein <
>>> tobias.sauerwein at camptocamp.com> wrote:
>>>> Hi!
>>>> I am wondering what happens when I start an asynchronous XMLHttpRequest
>>>> in a web worker and then terminate the web worker from the main script. Can
>>>> I assume that the request is closed properly? Because the "terminate a
>>>> worker algorithm" [1] does not explicitly say how to deal with open
>>>> requests.
>>>> Thanks,
>>>> Tobias
>>>> [1]:
>>>> http://www.whatwg.org/specs/web-workers/current-work/#terminate-a-worker
>>>> _______________________________________________
>>>> Help mailing list
>>>> Help at lists.whatwg.org
>>>> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20100728/c2c1872b/attachment-0002.htm>

More information about the Help mailing list