Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with server-generated events in gunicorn #28

Closed
lealbaugh opened this issue May 13, 2014 · 1 comment
Closed

Problem with server-generated events in gunicorn #28

lealbaugh opened this issue May 13, 2014 · 1 comment

Comments

@lealbaugh
Copy link

My Flask app can quite happily emit socket messages from within the @socketio.on() decorator, and when I run the app bare locally (with socketio.run(app)) I can also use socketio.emit('my response', {'data': 'Server generated event'}) as in the example code. However, when I use gunicorn as my server (gunicorn --worker-class socketio.sgunicorn.GeventSocketIOWorker mymodule:app), my @socketio.on()-decorated emit() works fine but my server-generated events fail silently. I have tried various namespaces for them, including no mentioned namespace, namespace="", and namespace="/test". I'm running the app with debug=False. What else can I try?

@miguelgrinberg
Copy link
Owner

This was a bug in the example app, which did not start the background thread that sends the server generated messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants