def register_socketio(app): socketio.init_app(app) # @socketio.on('connect', namespace='/websocket') # def test_connect(): # emit('server_response', {'data': 'ttt'}, namespace='/websocket') @socketio.on('joined', namespace='/websocket') def joined(message): """Sent by clients when they enter a room. A status message is broadcast to all people in the room.""" emit( 'message', { 'msg': current_user.username + " | " + str(current_user.id) + " | " + str(session['space_id']) }, ) @socketio.on('deploy', namespace='/websocket') def test_message(message): emit('message', {'msg': message['msg']}) from walle.service.deployer import DeploySocketIO wi = DeploySocketIO(12) current_app.logger.info(current_user.id) ret = wi.deploy() socketio.run(app, host='dev.admin.walle-web.io', port=5000)
def register_socketio(app): if len(sys.argv) > 1 and sys.argv[1] == 'db': return app socketio.init_app(app, async_mode='gevent') socketio.on_namespace(WalleSocketIO(namespace='/walle')) socketio.run(app, host=app.config.get('HOST'), port=app.config.get('PORT')) return app
def register_socketio(app): if len(sys.argv) > 1 and sys.argv[1] == 'db': return app socketio.init_app(app, async_mode='gevent') socketio.on_namespace(WalleSocketIO(namespace='/walle')) socketio.run(app, debug=True, host=app.config.get('HOST'), port=app.config.get('PORT')) return app
def register_socketio(app): # activate eventlet import eventlet eventlet.monkey_patch() socketio.init_app(app) socketio.on_namespace(WalleSocketIO(namespace='/walle')) socketio.run(app, host=app.config.get('HOST'), port=app.config.get('PORT')) return app
def register_socketio(app): socketio.init_app(app) socketio.on_namespace(WalleSocketIO(namespace='/walle')) socketio.run(app, host=app.config.get('HOST'), port=app.config.get('PORT')) return app
def register_socketio(app): socketio.init_app(app) socketio.on_namespace(WalleSocketIO(namespace='/walle')) socketio.run(app, host=app.config.get('HOST'), port=app.config.get('PORT')) return app