I am sending push notifications from my server and want it to just run in the background. I read the Laravel docs and I know about the database driver and some other options. I have work with the database driver on my local machine, but one thing is pushing me to start a background thread in order to listen for jobs that are added to the queue using php artisan queue:listen --deamon.
The fact is that it always consumes some of my resources and memory, working as a “crown” task. I just want to create a new process when I start a push notification, and it should start execution as soon as it is added, and after that this process should be closed. Although, on the other hand, with laravel jobs, I always need to start a background process that I want to avoid, and I also use shared hosting, which does not allow me to install a “supervisor” on my server to control the execution of my tasks.
Can anyone clear this ambiguity? What would be the best way to handle this scenario?
source
share