Closed vaibhavmule closed 3 years ago
just like this has a queue in this link https://github.com/encode/starlette/issues/20#issuecomment-587410233
Example something like this.
from flask import Flask from flask_sse import sse app = Flask(__name__) app.config["REDIS_URL"] = "redis://localhost" app.register_blueprint(sse, url_prefix='/stream') @app.route('/send') def send_message(): sse.publish({"message": "Hello!"}, type='greeting') return "Message sent!"
so I can use sse.publish anywhere in the code send things like notification to the client?
sse.publish
PS. I am using FastAPI
just like this has a queue in this link https://github.com/encode/starlette/issues/20#issuecomment-587410233
Example something like this.
so I can use
sse.publish
anywhere in the code send things like notification to the client?PS. I am using FastAPI