Python Flask SocketIO broadcasting outside of @socketio context
问题 I'm trying to send a broadcast when an outside value changes. Camonitor calls the callback when the value changes, and I want to notify all connected clients that the value has changed and they need to refresh. from flask import Flask from epics import caget, caput, camonitor from flask_socketio import SocketIO, emit app = Flask(__name__) socketio = SocketIO(app) @socketio.on('connect') def local_client_connect(): print "Client connected" def update_image_data(pvname, value, **kw): #