Thanks for the answer, really helped, but I&#39;m stuck again in other case.<div><a href="http://stackoverflow.com/questions/9335509/using-wsgi-on-twisted">http://stackoverflow.com/questions/9335509/using-wsgi-on-twisted</a></div>

<div>I&#39;m using mod_wsgi now, and I&#39;m really lost about how to use twisted methods.</div><div><br></div><div>Thanks again!</div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">2012/2/16  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 12:26 pm, <a href="mailto:joaoricardo000@gmail.com">joaoricardo000@gmail.com</a> wrote:<br>
&gt;[snip]<br>
<div class="im">&gt;<br>
&gt;def doStuff(self,d,msg):<br>
&gt;    # do some stuff<br>
&gt;    time.sleep(2)  #just for example<br>
&gt;    d.callback(&#39;ok&#39;)<br>
&gt;<br>
</div>&gt;[snip]<br>
<div class="im">&gt;So far, so good, but, the HTTP response (return &#39;done&#39;), only happens<br>
&gt;after<br>
&gt;the delay (time.sleep(2)). I can tell this, because the browser keeps<br>
&gt;&#39;loading&#39; for 2 seconds.<br>
&gt;<br>
&gt;What am I doing wrong?<br>
<br>
</div>Answered on Stack Overflow:<br>
<br>
<a href="http://stackoverflow.com/questions/9310350/twisted-non-blocking-method-" target="_blank">http://stackoverflow.com/questions/9310350/twisted-non-blocking-method-</a><br>
how-to<br>
<div class="im">&gt;Found some answer saying that wsgi twisted does not suport assync, and<br>
&gt;maybe Tornado could do this. ... is that true?<br>
<br>
</div>By definition, WSGI applications are not asynchronous.  However, your<br>
code is not a WSGI application, so the nature of WSGI applications is<br>
irrelevant.<br>
<br>
Tornado doesn&#39;t change these facts.  WSGI for Tornado is the same as<br>
WSGI for anything else.<br>
<br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-web mailing list<br>
<a href="mailto:Twisted-web@twistedmatrix.com">Twisted-web@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><b>João Ricardo Mattos e Silva</b><br><br><span style="font-size:x-small">Graduando em Ciência da Computação na Universidade Federal de Santa Catarina<br></span><br>

<b><font face="&#39;courier new&#39;, monospace">Cel: </font></b><font face="&#39;courier new&#39;, monospace">+55 (48) 96190063  |  <b>Skype:</b> jricardomsilva  | <b> Msn: </b><a href="mailto:joaoricardo@globalite.com.br" target="_blank">joaoricardo@globalite.com.br</a></font><br>


</div>