首页 > 如何只使用tornado的websocket模块而不使用它的web server呢?

如何只使用tornado的websocket模块而不使用它的web server呢?

最近在做一个项目中要用到websocket来实时展示数据,但是项目用的web server是公司内部自己写的框架,不知道怎么把tornado的websocket集成到上面?


Tornado提供了一个WSGIAdapter类,可以让Tornado运行在其他WSGI上,但是

官方中提到:

In WSGI mode asynchronous methods are not supported. This means that it is not possible to use AsyncHTTPClient, or the tornado.auth or tornado.websocket modules.

所以在其他WSGI上使用tornado的websocket功能估计是很困难的。

如果你不是一定要用tornado,我建议你可以看看这些websocket模块,特别是WebSocket-for-Python模块
https://github.com/vinta/awesome-python#websocket


要看你公司的源码是怎么实现的。

【热门文章】
【热门文章】