Server-Sent Events with Nginx and uWSGI

你离开我真会死。 提交于 2019-12-08 18:11:03

问题


Is it possible to use server-sent events from a python/Flask application that is behind uWSGI and Nginx?

I've found packages that implement SSE in python/Flask, but they seem to all do so using gevent and greenlets.

https://github.com/DazWorrall/flask-sse

Thanks!


回答1:


can't you simply use gevent with uWSGI ?

Generally this kind of technologies should be used with async engines as the multithread/multiprocess paradigm would be too much costly.




回答2:


Recent versions of uWSGI (from 1.9) have built-in support for websockets / SSE. This article provides an excellent guide:

uWSGI docs: Offloading Websockets and Server-Sent Events



来源:https://stackoverflow.com/questions/15345603/server-sent-events-with-nginx-and-uwsgi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!