Does Django have a way to open a HTTP long poll connection?

后端 未结 3 1943
刺人心
刺人心 2020-12-01 12:50

Leave the connection open, until an event occurs.

3条回答
  •  执念已碎
    2020-12-01 13:26

    For the future readers :)

    I created a simple long polling django class views using Gevent, you can find it on github on https://github.com/tbarbugli/django_longpolling or get it from pypi (django_longpolling)

    EDIT: I did some further experiment / deployment with django long polling / async workers and I can say that if possible opting to an external daemon is a very good choice, especially if you use the db (when using async worker you need a db connection pool or you are going to have the amount of worker connections bound to your db connection limits which is not desiderable).

提交回复
热议问题