title: Laravel Queue fall asleep when Queue is empty
body: <p>I have a controller function which dispatchs a <code>job</code>. When this <code>job</code> is handled, at the end it dispatch the same <code>job</code> again (with different args). There are 5 jobs of the same in total.</p>
  
  <p><code>Queue driver: database</code></p>
  
  <p>The problem is: I record the time duration from <code>create()</code> to <code>handle()</code>. The first job dispatched by the controller took 1700ms, where the other jobs dispatched by the jobs themselves took only 40ms.</p>
  
  <p><code>Queue driver: sync</code></p>
  
  <p>When I changed to use <code>sync</code> queue driver, all the jobs worked in lightning speed.</p>
  
  <p><strong>Findings:</strong></p>
  
  <p>The first queue job took long time from <code>create()</code> to <code>handle()</code>. Before that the queue was empty. It might be the queue driver problem.</p>
  
  <p>Why and how to fix please? thanks!!</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Added a <code>TestJob</code> that dispatch itself when job was handled. That meant the queue always had a <code>TestJob</code> being handled or waiting for handling.</p>
  
  <p>Repeating my original jobs, they all took only &lt;70ms from <code>created()</code> to <code>handle()</code> completed.</p>
  
  <p><strong>Conclusion:</strong></p>
  
  <p>I am pretty sure it is the queue driver problem. Looks like the worker fall asleep when the queue is empty. Do anyone know the fix please?</p>