Hacker News new | ask | show | jobs
by gane5h 4508 days ago
Two ways you can do this:

1. Long polling: It’s definitely possible to have thousands of long-lived requests with something like gunicorn/tornado. Remember to turn-off buffering in your front-end nginx proxy if you want to use long-polling.

2. Async with web hooks. Gather the request payload, push it to a job queue, and return the response. Process the job queue at your leisure and then call the web hook when complete. You can use celery, beanstalk or my personal choice rq (and django-rq.)

1 comments

Thanks gane5h. Can you point me to an example that shows how to use django framework for long-lived requests via gunicorn/tornado?
There're many examples on GitHub, here's one I found just by searching: https://github.com/tbarbugli/django_longpolling