setCache() public method

Set the cache repository implementation.
public setCache ( Illuminate\Contracts\Cache\Repository $cache ) : void
$cache Illuminate\Contracts\Cache\Repository
return void
Beispiel #1
4
 /**
  * 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['Illuminate\\Contracts\\Debug\\ExceptionHandler']);
         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'));
 }
 /**
  * Run the worker instance.
  *
  * @param  string  $connection
  * @param  string  $queue
  * @return array
  */
 protected function runWorker($connection, $queue)
 {
     $this->worker->setCache($this->laravel['cache']->driver());
     $method = $this->option('once') ? 'runNextJob' : 'daemon';
     return $this->worker->{$method}($connection, $queue, $this->gatherWorkerOptions());
 }