title: Laravel Artisan CLI safely stop daemon queue workers
body: <p>In order to process large numbers of jobs, I run a variable number of queue workers depending on howmuch work there is to complete. I don't want to run more workers than are necessary to complete the work that needs to be done in a time period that we deem appropriate.</p>
  
  <p>At the moment, I start 5 daemon queue workers for testing purposes, however in production this number could be between 25 &amp; 100 workers, possibly more. I understand that when deploying, I have to stop the queue workers by first placing the framework in maintenance mode by using <code>php artisan down</code>, because the <code>--daemon</code> flag causes the framework to only load when the worker starts up, hence new code would not take affect during the deploy until the worker restarts.</p>
  
  <p>If i needed to stop the workers for some reason, I could put the application in maintenance mode using <code>php artisan down</code> which will cause the workers to die once they have finished processing their current job (if they are working one). However, there may be times where I want to kill the workers without putting the whole application in maintenance mode.</p>
  
  <p><strong>Is there a safe way to stop the workers in a way where they will continue processing their current job and then die without placing the whole application in maintenance mode?</strong></p>
  
  <p><strong>Essentially what I need is a <code>php artisan queue:stop</code>, which behaves like <code>php artisan queue:restart</code>, but does not restart the worker once the job is done.</strong></p>
  
  <p>I was expecing there to be a like <code>php artisan queue:stop</code> command that would do this, but that doesn't seem to be the case.</p>
  
  <p>Using <code>ps aux | grep php</code> I am able to get the process id's for the workers, and I could kill the processes that way, but I don't want to kill the process in the middle of it working on a job.</p>
  
  <p>Thanks.</p>