<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class StreamSubscriberAckCommand extends AbstractCommand
{
    public function name(): string { return 'stream:subscriber:ack'; }
    public function description(): string { return 'PPphp Stream Subscriber Ack'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Stream Subscriber Ack');
        $runtime = \PpPhp\Core\Platform\Event\Streaming\Subscriber\StreamSubscriberRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); $ok = $runtime->acknowledge('subscriber.console'); $this->line('Acknowledged: ' . ($ok ? 'YES' : 'NO'));
        return 0;
    }
}
