Resque\Commands\Hosts::execute PHP Метод

execute() защищенный Метод

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $hosts = Resque\Redis::instance()->smembers(Resque\Host::redisKey());
        if (empty($hosts)) {
            $this->log('<warn>There are no hosts with running workers.</warn>');
            return;
        }
        $table = new Resque\Helpers\Table($this);
        $table->setHeaders(array('#', 'Hostname', '# workers'));
        foreach ($hosts as $i => $hostname) {
            $host = new Resque\Host($hostname);
            $workers = Resque\Redis::instance()->scard(Resque\Host::redisKey($host));
            $table->addRow(array($i + 1, $hostname, $workers));
        }
        $this->log((string) $table);
    }