Illuminate\Queue\Worker::setCache PHP Method

setCache() public method

Set the cache repository implementation.
public setCache ( Illuminate\Contracts\Cache\Repository $cache ) : void
$cache Illuminate\Contracts\Cache\Repository
return void
    public function setCache(CacheContract $cache)
    {
        $this->cache = $cache;
    }

Usage Example

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'));
 }
All Usage Examples Of Illuminate\Queue\Worker::setCache