Replies: 2 comments
-
Nothing wrong with using an HTTP request, but I don't understand why you say that you'll be instantiating a new object when you use the message queue method. The |
Beta Was this translation helpful? Give feedback.
0 replies
-
Oh, I think I misunderstood. My celery tasks were in a separate file and I was instantiating socketio inside my celery task for some reason. I will make socketio a global variable in my tasks.py. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
According to documentation when emitting from external processes one can instantiate a
SocketIO
instance (given one is using a message queue) and emit using that.However, another way is to cause an emit from the external process might be to fake a POST request to the server and and emit from that event handler.
I was wondering if there is any downside to using the second approach or if you recommend both approaches?
While I do prefer the former approach and realize that faking POST requests might hog the server, having a separate message queue and instantiating a new object every time might also hog the celery worker (my external process).
Thanks
Beta Was this translation helpful? Give feedback.
All reactions