I'm currently working on a project where I would like to initiate an AJAX request to my backend which should call multiple APIs in parallel and should also return each result separately back to the frontend which should then process it.
I know that PHP isn't well known for multithreading so my main question is if it's possible and if yes, how would you tackle it?
I used the
requestAsync() method of Guzzle which could be used to fire off multiple API requests in parallel. The problem is, that I need to wait for all responses before sending the response for the frontend. Do you have an idea if there is another way?
Alternatives I thought about could be:
What do you think about it?
Thanks a lot!!