title: Python asynchronous request handling while calling subprocess
body: <p>I have a REST API written in Flask and using the Tornado web server.</p>
  
  <p>When a request comes in, I execute a long running shell command using <code>tornado.process.Subprocess</code>.</p>
  
  <p>Is there a way to keep handling new requests while the shell command is running, and return the result after the shell command is complete.</p>
  
  <p>I am thinking</p>
  
  <pre><code>from tornado import gen
  from tornado.process import Subprocess
  
  @gen.coroutine
  def callSubProcess(commandString):
      p = Subprocess(commandString)
      yield p.wait_for_exit()
      raise gen.Return(someResult)
  
  @app.route(url, methods=['POST'])
  @gen.coroutine
  def process():
      result = yield callSubProcess(commandString)
      raise gen.Return(result)
  
  http_server = HTTPServer(WSGIContainer(app))
  http_server.listen(5000)
  IOLoop.instance().start()
  </code></pre>
  
  <p>But this doesn't seem to work:
  I just get <code>'Future' object is not callable</code> when making a request.  What is the problem here?</p>