title: Flask long routines
body: <p>I have to do some long work in my Flask app. And I want to do it async. Just start working, and then check status from javascript.</p>
  
  <p>I'm trying to do something like: </p>
  
  <pre><code>@app.route('/sync')
  def sync():
      p = Process(target=routine, args=('abc',))
      p.start()
  
      return "Working..."
  </code></pre>
  
  <p>But this it creates defunct gunicorn workers.</p>
  
  <p>How can it be solved? Should I use something like Celery?</p>