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

socketio_emit() in background thread in called but never emit to client side #46

Open
greggzj opened this issue Apr 9, 2019 · 1 comment

Comments

@greggzj
Copy link

greggzj commented Apr 9, 2019

Hello, thanks for sharing the great demo repository. Just find a little problem regarding to socketio_emit() in function socketio_notify in background thread. Hoping for your feedback, thanks in advance!

This demo using built in Thread to start a background (rather than using eventlet to spawn a thread), and start the socketio in main thread. Which means that when specific dbus signal is recevied, the socketio_emit() in another thread (background) will be triggered.

But actually when receving the dbus signal, socketio_emit() is triggered but client side won't received any message emit by server.

Since requirements.txt contains eventlet which is the first choice as per flask socketio document. If I added

import eventlet
eventlet.monkey_patch()

at the front of run.py ,
or

explicily setting async_mode to threading as input parameter when initiating socketIO

this problem will be resolved.

Not digging further on eventlet/gevent/threading....If you know , please do not hesitate to tell me.

Hoping for your feedback!

@greggzj
Copy link
Author

greggzj commented Apr 15, 2019

The environment was on Ubuntu 18.04.

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

1 participant