TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introducing Flask-Sockets

63 pointsby jnollerover 11 years ago

7 comments

stevenweiover 11 years ago
Thanks for this. A few months ago I looked into getting gevent-socketio up and running to do real-time messaging between a Flask app and an iOS app. gevent-socketio provides event handling and a messaging protocol on top of websockets that I thought would be useful.<p>However, based on my testing, in its current state it&#x27;s nowhere near ready for production. There are some serious bugs relating to memory leaks, improperly closing stale sockets, and deployment on Gunicorn with # workers &gt; 1 is not currently possible. (And in practice I don&#x27;t think you would want to deploy on anything besides Gunicorn.) The project also seems to be somewhat inactive, there are a lot of open critical issues and there hasn&#x27;t been any real activity in the last 6 months or so.<p>At this point I am considering removing the library and using a straight websocket implementation with a simpler protocol instead.
评论 #6481854 未加载
codysoylandover 11 years ago
This looks like a thin wrapper over gevent-websocket. The code is slightly longer than the README: <a href="https://github.com/kennethreitz/flask-sockets/blob/master/flask_sockets.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kennethreitz&#x2F;flask-sockets&#x2F;blob&#x2F;master&#x2F;fl...</a><p>Not to discredit the attempt to make gevent-websocket more accessible, but there&#x27;s nothing really new here. Here&#x27;s an example of using gevent-websocket with flask without this library: <a href="https://gist.github.com/lrvick/1185629" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;lrvick&#x2F;1185629</a>
评论 #6477165 未加载
twismover 11 years ago
Websockets in python is easy.<p><a href="http://www.tornadoweb.org/en/stable/websocket.html" rel="nofollow">http:&#x2F;&#x2F;www.tornadoweb.org&#x2F;en&#x2F;stable&#x2F;websocket.html</a>
评论 #6477421 未加载
toanantover 11 years ago
Flask users will be grateful for support of web-sockets, because beginner in python can use flask &amp; now flask-sockets too for building small but useful projects. Thanks Reitz for this.
rubycowgamesover 11 years ago
I&#x27;ve been using gevent-socketio for websockets with Flask. I&#x27;m new to python. Can someone tell me why I&#x27;d want to use this over gevent-socketio?
评论 #6476983 未加载
评论 #6478585 未加载
sshThisover 11 years ago
A few questions, does this work with Python 3.3?<p>Also, how is it better than Tornado web sockets?
评论 #6477000 未加载
评论 #6477536 未加载
评论 #6476994 未加载
PhasmaFelisover 11 years ago
I was kind of hoping this would be some sort of power socket shaped like a pocket flask.