I have a performance issue in a cakephp application I’m maintaining.
When the user makes a requests to one of our endpoints, my Controller starts to make API calls to a third party service to send e-mails. But making these API requests takes some time and I want to send back a response to my users before the calls to the third party service has completed. (The results of the API calls will have no impact on the response to my user)
I want to be able to send the response to my user quickly because otherwise the user will notice a delay in the web application.
How would you solve an issue like this? Is there support for threads, worker queues, async or multiprocessing or any other concepts the young people are talking about in CakePHP?
which both basically allow you to fill a queue with tasks and a (from the request) separately working runner will perform those tasks in the background.
After some comparison between the three options, we are going to choose dereuromark’s plugin since it uses the same database as the rest of the application. Using something like Redis together with cakephp/queue would might perform better but we don’t need that extra infrastructure overhead at this stage.
Also having no dependencies is also good in my view and I really liked the documentation.