Answer the question
In order to leave comments, you need to log in
What logic to choose in sending messages to the client via sockets in Laravel?
Task. I receive data every second, and through sockets it is necessary to give them to the client. If you use Laravel echo, this means that every second an event will be launched that will be sent to users (I don’t know if this is normal in terms of optimization?) In addition, users will have different subscriptions. Or is it not a problem for php?
Am I right in thinking that it is better to give such weights to the node completely, bypassing the Laravel backend? True, a problem arises if you need to give by subscription, but you can make separate pages for different roles with checking access to the page (probably this is not the best option)
Answer the question
In order to leave comments, you need to log in
Well, I hack in one project every 15ms. Of course, it does not come every 15ms, but it works very perky. There is no load from the PHP side, and then it's up to the socket server.
Once a second for a server socket is about nothing. Yes, even if you send tens of thousands of clients a hundred times a second - don't give a fuck, this is already the task of socket servers and it scales very easily.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question