gevent-socketio send message from thread
问题 I would like to use gevent-socketio to send messages from a worker thread and update all connected clients on the status of the job. I tried this: from flask import Flask, render_template from flask.ext.socketio import SocketIO, send, emit import threading import time app = Flask(__name__) app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app) @socketio.on('message') def handle_message(message): send(message, broadcast=True) @app.route('/') def index(): return render_template('index