-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Want to send SSE with RQ worker, how to configure? #31
Comments
Did you manage to make this work? |
Not really. I've been using websockets instead... |
It should work as you can send messange only using a redis connection. You don't need to import from redis import StrictRedis
import json
conn = StrictRedis()
conn.publish(channel_id, json.dumps({"data": {}}) |
Can I send SSEs using an RQ worker running in a different docker container?
My code looks like this right now:
Explanation: Any single client will be connected to a
content_id
and will listen formarkers
andstatus
, as these are both needed to populate the frontend page.The worker will do some CPU heavy processing and generate the
marker_data
andstatus_data
periodically on a cron schedule. The worker would need to independently send this to all the clients connected on that particular channel.Where do I put the API endpoint? I don't really see a reason for it here? But on the client side I need to provide a value to the
EventSource
declaration:Any help will be much appreciated.
The text was updated successfully, but these errors were encountered: