Example #1
0
 protected function doRename($key, $target)
 {
     $item = $this->data->remove($key);
     $this->data->set($target, $item);
     if ($this->expiring->containsKey($key)) {
         $time = $this->expiring->remove($key);
         $this->expiring->set($target, $time);
     }
 }
Example #2
0
 private function getStats(InputInterface $input, OutputInterface $output)
 {
     $queue = $this->getQueue();
     if (!($tubes = $input->getArgument('tube'))) {
         $stats = $queue->statsAllTubes();
         $error = false;
     } else {
         /** @var $tubes TubeCollection */
         list($tubes, $error) = $this->matchTubeNames($tubes, $output);
         $stats = new ArrayCollection();
         foreach ($tubes as $name => $tube) {
             $stats->set($name, $tube->stats());
         }
     }
     return array($stats, $error);
 }
Example #3
0
 public function statsAllTubes()
 {
     $stats = new ArrayCollection();
     foreach ($this->tubes as $tube) {
         $stats->set($tube, $this->statsTube($tube));
     }
     return $stats;
 }