Answer the question
In order to leave comments, you need to log in
How to make emit through redis in flask?
Hello! emit not working
emit("message", respones, namespace='/app/auction', room="1")
from flask import Flask
from flask_socketio import SocketIO
from .db import DataBase
import eventlet
eventlet.monkey_patch()
socketio = SocketIO(logger=True, engineio_logger=True, cors_allowed_origins="*", async_mode='eventlet')
database = DataBase("base.db")
UPLOAD_FOLDER = 'uploads'
def create_app(debug=False):
"""Create an application."""
app = Flask(__name__, static_url_path="", static_folder='/')
app.debug = debug
app.config['SECRET_KEY'] = 'gjr39dkjn344_!67#'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
from .main import main as main_blueprint
app.register_blueprint(main_blueprint)
socketio.init_app(app, message_queue='redis://')
return app
received event "new_message" from FT3WMkqGYeDhWi6ZAAAJ [/app/auction]
emitting event "message" to 1 [/app/auction]
Cannot publish to redis... retrying
Cannot publish to redis... giving up
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question