title: Twisted non-blocking method - how to?
body: <p>My code looks like this:</p>
  <pre><code>... # class Site(Resource)
  def render_POST(self,request)
     otherclass.doAssync(request.args)
     print '1'
     return &quot;done&quot; #that returns the HTTP response, always the same.
  
  ...
  
  def doAssync(self,msg):
      d = defer.Deferred()
      reactor.callLater(0,self.doStuff,d,msg)
      d.addCallback(self.sucess)
  
  def doStuff(self,d,msg):
      # do some stuff
      time.sleep(2)  #just for example
      d.callback('ok')
  
  def sucess(msg):
      print msg
  </code></pre>
  <p>The output:</p>
  <blockquote>
  <p>1</p>
  <p>ok</p>
  </blockquote>
  <p>So far, so good, but, the HTTP response (return 'done'), only happens after the delay (time.sleep(2)).
  I can tell this, because the browser keeps 'loading' for 2 seconds.</p>
  <p>What am I doing wrong?</p>