src/Worker.php
public function listen($interval = 5, $timeout = 0)
    {
        while (true) {
            // Process the current job if available
            // or sleep for a certain time
            if ($manager = $this->getManager($timeout)) {
                $manager->execute();
            } elseif ($interval > 0) {
                $this->sleep($interval);
            }
        }
    }
public function listen($interval = 5, $timeout = 0)
    {
        while (true) {
            // Process the current job if available
            // or sleep for a certain time
            if ($manager = $this->getManager($timeout)) {
                $manager->execute();
            } elseif ($interval > 0) {
                $this->sleep($interval);
            }
        }
    }
public function listen ( $ interval = 5 , $ timeout = 0 ) { while ( true ) { // Process the current job if available // or sleep for a certain time if ( $ manager = $ this -> getManager ( $ timeout ) ) { $ manager -> execute ( ) ; } elseif ( $ interval > 0 ) { $ this -> sleep ( $ interval ) ; } } }
Listens to queue

@param float   $interval Sleep for certain time if no job is available
@param integer $timeout  Wait timeout for pop
Listens to queue