Last active
November 5, 2019 20:13
-
-
Save rienafairefr/aba4011dade7a1421c4c2ca1f5971a1d to your computer and use it in GitHub Desktop.
grpc-gevent error under flask-socketio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[source]] | |
name = "pypi" | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
[dev-packages] | |
[packages] | |
gevent = "*" | |
Flask-SocketIO = "*" | |
google-cloud-firestore = "*" | |
[requires] | |
python_version = "3.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, jsonify | |
from flask_socketio import SocketIO | |
from google.cloud import firestore | |
app = Flask(__name__) | |
socketio = SocketIO(app) | |
db = firestore.Client() | |
@app.route('/') | |
def get_(): | |
return jsonify(list(el.to_dict() for el in db.collection('connections').stream())) | |
if __name__ == '__main__': | |
socketio.run(app, use_reloader=True, debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matthieu@zurkus:~/repro-grpc-gevent$ http get http://localhost:5000/ | |
HTTP/1.1 200 OK | |
Content-Length: 9 | |
Content-Type: application/json | |
Date: Tue, 05 Nov 2019 19:54:48 GMT | |
[ | |
{} | |
] | |
matthieu@zurkus:~/repro-grpc-gevent$ http get http://localhost:5000/ | |
=> hangs forever |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment