Пример #1
0
 /**
  * Run the worker instance.
  *
  * @param  string  $connection
  * @param  string  $queue
  * @param  int  $delay
  * @param  int  $memory
  * @param  bool  $daemon
  * @return array
  */
 protected function runWorker($connection, $queue, $delay, $memory, $daemon = false)
 {
     if ($daemon) {
         $this->worker->setCache($this->laravel['cache']->driver());
         $this->worker->setDaemonExceptionHandler($this->laravel['exception']);
         return $this->worker->daemon($connection, $queue, $delay, $memory, $this->option('sleep'), $this->option('tries'));
     }
     return $this->worker->pop($connection, $queue, $delay, $this->option('sleep'), $this->option('tries'));
 }
Пример #2
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $queue = $this->option('queue');
     $delay = $this->option('delay');
     // The memory limit is the amount of memory we will allow the script to occupy
     // before killing it and letting a process manager restart it for us, which
     // is to protect us against any memory leaks that will be in the scripts.
     $memory = $this->option('memory');
     $connection = $this->argument('connection');
     $this->worker->pop($connection, $queue, $delay, $memory, $this->option('sleep'));
 }