Skip to content

Instantly share code, notes, and snippets.

@rienafairefr
Last active November 5, 2019 20:13
Show Gist options
  • Save rienafairefr/aba4011dade7a1421c4c2ca1f5971a1d to your computer and use it in GitHub Desktop.
Save rienafairefr/aba4011dade7a1421c4c2ca1f5971a1d to your computer and use it in GitHub Desktop.
grpc-gevent error under flask-socketio
[[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"
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)
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