getWork() public method

Get the next command and remove it from the queue
public getWork ( ) : Command | null
return Command | null
Beispiel #1
0
 /**
  * Execute all items in the work queue in a single transaction
  */
 private function flushMulti()
 {
     $this->clientCmd('pipeline', function ($pipe) {
         /* @var Pipeline $pipe */
         while ($command = $this->unit_of_work->getWork()) {
             $pipe->executeCommand($this->getPredisCommand($command));
         }
     });
 }
Beispiel #2
0
 /**
  * Execute the current unit of work
  *
  * @return void
  */
 public function flush()
 {
     while ($work = $this->unit_of_work->getWork()) {
         $this->worker_pool->execute($work);
     }
 }