I have a long running task that is called in the controller, but I don’t want the user to have to wait for a long time for the page to load. What is the recommended way to call the function asynchronously?
I researched this topic, but there seems to be so many ways to do it, and all of them are quite complicated, or compromise on the security.
CI4 v4.3.5
PHP v8.2.21
I have tested the spatie/async package, which seemed the simplest to use, but it only lets you run multiple threads at the same time, but you have to wait for them to finish to continue.
I also tried calling my function using a spark command, but you still have to wait for it to finish.
I want to run 1 task separately so that the user can load their page faster.
Wrestling Potato is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.