The Python Oracle

Flask socket IO emit from another module

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Secret Catacombs

--

Chapters
00:00 Question
02:33 Accepted answer (Score 3)
02:55 Thank you

--

Full question
https://stackoverflow.com/questions/5932...

Accepted answer links:
[documentation]: https://flask-socketio.readthedocs.io/en...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #flask #socketio #flasksocketio

#avk47



ANSWER 1

Score 2


Please try and install Redis and eventlet for asynchronous calls and to send messages from other modules. As described in the documentation then you can change your line in app.py to

socketio = SocketIO(app, cors_allowed_origins="*", message_queue='redis://', async_mode='eventlet')