Parallel async execution with websockets #887
Unanswered
FlaviuRadulescu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a quick question related to the Workerman web-socket implementation.
From my tests, I see that all the messages are executed synchronously. Basically the callback from the onMessage method is run message after message. The problem I have is that on this onMessage callback I need to send something back to the customers, as some customers are far away from the server (in terms of distance->milliseconds) this takes time, and because of this I cannot have high performance in real-world, as I am waiting for 100-250 ms for each customer. Was wondering if there is a way in which I could fork or do something similar so that I could "talk" to more customers in a parallel way. Is this a setting that I could configure? Would it work if I fork inside the onMessage callback?
What is best practice in such a case?
Thank you,
Beta Was this translation helpful? Give feedback.
All reactions