Resque\Queue::redisKey PHP Méthode

redisKey() public static méthode

Get the Queue key
public static redisKey ( Queue | null $queue = null, string | null $suffix = null ) : string
$queue Queue | null the worker to get the key for
$suffix string | null to be appended to key
Résultat string
    public static function redisKey($queue = null, $suffix = null)
    {
        if (is_null($queue)) {
            return 'queues';
        }
        return (strpos($queue, 'queue:') !== 0 ? 'queue:' : '') . $queue . ($suffix ? ':' . $suffix : '');
    }

Usage Example

Exemple #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $queues = Resque\Redis::instance()->smembers('queues');
     if (empty($queues)) {
         $this->log('<warn>There are no queues.</warn>');
         return;
     }
     $table = new Resque\Helpers\Table($this);
     $table->setHeaders(array('#', 'Name', 'Queued', 'Delayed', 'Processed', 'Failed', 'Cancelled', 'Total'));
     foreach ($queues as $i => $queue) {
         $stats = Resque\Redis::instance()->hgetall(Resque\Queue::redisKey($queue, 'stats'));
         $table->addRow(array($i + 1, $queue, (int) @$stats['queued'], (int) @$stats['delayed'], (int) @$stats['processed'], (int) @$stats['failed'], (int) @$stats['cancelled'], (int) @$stats['total']));
     }
     $this->log((string) $table);
 }
All Usage Examples Of Resque\Queue::redisKey