PHP/Laravel: Best practice to deliver search results subsequently from server to client (async)

QuestionsPHP/Laravel: Best practice to deliver search results subsequently from server to client (async)
sethbeckerman5 Staff asked 4 years ago

In the frontend the user submits a search request. The server will then utilize multiple external APIs to gather results. Whenever an API returns a result this should be send to the client.
An example are flight search engines that will show you results coming in subsequently.
I would like to handle this in Laravel, as we have worked with that for some time successfully.
Laravel Websockets: I'm concernced by that overhead with the extra WebsocketServer process run by supervisor; Also, currently it is so, that for a private channel, a user needs to be logged in, which is unacceptable for our public search website
Polling: I thought about submitting the external API searches to the queue, but my concern is, that due to the async queue worker (maybe checking every 5 seconds), the whole search takes too long; also, the queue worker is again a resource eating process I would like to avoid
What would you recommend?
Thank you for your help!


View on Stack Overflow