0

I'm using falcon as my web server back-end, and wrap it with uwsgi, very much similar to this example. I want to offload a task, like uwsgi allows. I want a POST request to produce a 202, and to start a thread that takes care of the request.

In uwsgi it's done with offload-threads = X. Does anyone know how to achieve this with falcon?

speller
  • 1,641
  • 2
  • 20
  • 27

1 Answers1

0

AFAIK, Falcon doesn't have any native way to accomplish this. But you may try to either: - Put your task into a Celery task - Or let the webserver handle that for you. E.g. With gunicorn you can create have workers (based on greenlet, tornado, and other concurrency implementation). You can you do something like:

gunicorn --workers=4 myapp:app --worker-class='gevent'

Check this thread for some additional info: Python falcon and async operations

Community
  • 1
  • 1
joarleymoraes
  • 1,891
  • 14
  • 16