how to know flask_socketio is connected #1898
Unanswered
6273parastu
asked this question in
Q&A
Replies: 1 comment
-
When a client disconnects the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi, i need to know connection socketio is alive or is connected when i use in
start_background_task
, for e.x:@socketio.on('connect')
@authenticated_only
def on_connect():
connection_id = request.sid
socketio.start_background_task(target=background_thread_from_stream, app=current_app._get_current_object(), connection_id=connection_id)
def background_thread_from_stream(self, app, connection_id):
with app.app_context():
while connection_id is connected:
do_somtitng()
Beta Was this translation helpful? Give feedback.
All reactions