<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class DistributedQueueRegisterCommand extends AbstractCommand
{
    public function name(): string { return 'distributed:queue:register'; }
    public function description(): string { return 'PPphp Distributed Queue Register'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Distributed Queue Register');
        $manager = \PpPhp\Core\Platform\Event\Distributed\Queue\DistributedQueueCoordinator::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); $queue = $manager->registerQueue('console.queue', 1); $manager->updateCounters('console.queue', 3, 0); $this->line('Registered: ' . $queue->queueName());
        return 0;
    }
}
