I'm doing a bit of socket.io work in an application that demands high frequency updates with minimal wait times (imagine a commentator annotating a video livestream, with viewers both watching the video and recieving updates from the commentator). Essentially the architecture I feel like I need to implement is this:User (The commentator) POST's message to PHP server over HTTP.PHP server receives POSTServer broadcasts an event and/or pushes a hash onto RedisNode.js server listens to Redis channel and picks up messagessocket.io sends out messages to all clientsClients recieved original message.To be honest, I'm not even sure whether this is the correct way to do this. There may be a more effective way to complete this cycle, and if there is, I'm more than happy to consider it! My specific question is regarding what happens between steps 2 & 3. In between there, I also want to POST that message to a 3rd party service. The only issue that is concerning me is the response time from the 3rd party API. The nature of what I'm trying to build requires a fast turnaround, so I cannot afford for my 3rd party API to hold up the rest of the process. I also cannot guarantee that the API I am interfacing with will respond quickly or even respond at all. Is there a way, after the PHP server receives a POST message, I can somehow run a piece of code that interfaces with this 3rd party API asynchronously, so as to not hold up the flow of my application?I'm using Laravel 5.1 as my PHP framework, and from what I've seen, Broadcasting Events may hold some promise, but I'm not familiar enough with the specific implementation details to ensure that this meets my requirements. I'm also considering using Node.js for the websockets server, Redis for the publication/broadcasting, and socket.io. Furthermore, is it possible to get a PHP server to listen to a websocket broadcast? Or do I have to POST via HTTP?I'd love to be advised on what I can look into to meet this criteria, and an overall critique of my proposed architecture would be nice too. Thanks.
Broadcasting events asynchronously in a high frequency application to prevent hangs?
php;asynchronous programming;websockets