<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Queue;

final class QueueStatistics
{
    public function __construct(
        private readonly string $driver,
        private readonly int $size,
        private readonly int $pending,
        private readonly int $cancelled = 0,
        private readonly int $failed = 0
    ) {}

    public function driver(): string { return $this->driver; }
    public function size(): int { return $this->size; }

    public function toArray(): array
    {
        return [
            'driver' => $this->driver,
            'size' => $this->size,
            'pending' => $this->pending,
            'cancelled' => $this->cancelled,
            'failed' => $this->failed,
        ];
    }
}
