Yes... your ajax calls are non-blocking but you just happen to be
calling a server that itself is blocking.
Here's a link to an example of a simple Tornado program altered to
handle requests in a non-blocking way:
http://gist.github.com/246618
This was provided to me when I ran into the same problem. You set up
PeriodicCallback (from ioloop) to handle the blocking part of the
request. The request stays open as far as the client browser is
concerned. When the blocking call is ready to respond to the request,
it calls the finish() method. Just be sure to stop the scheduler, too.
On Dec 9, 3:32 am, Harsh K <
simplyha...@gmail.com> wrote:
> Hey All.
>
> I recently started testing TornadoWeb for a home-project, which uses
> jquery getJSON function to call my tornado handlers. And found
> something strange, which i seek an explanation for.
>
> I fire an ajax request for *Handler1* on tornado, and in some cases
> request for *Handler2* is initiated before *Handler1* returns. It
> appears from development-server logs, and firebug console-debugging,
> that *Handler2* request waits for *Handler1* request to finish, and
> then return. So basically, XHR call is waiting for earlier XHRs. They
> are supposed to be asynchronous/non-blocking right?? Or am i missing
> something.
>
> You can check the test-case environment called *testtornado* at
> *
http://github.com/harshh/Harsh-Projects/*with main.py as server