<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Queue\Contracts;

use PpPhp\Core\Platform\Event\Queue\DeferredEvent;
use PpPhp\Core\Platform\Event\Queue\QueueSnapshot;
use PpPhp\Core\Platform\Event\Queue\QueueStatistics;

interface QueueDriverInterface
{
    public function name(): string;
    public function push(DeferredEvent $event): string;
    public function pop(): ?DeferredEvent;
    public function peek(): ?DeferredEvent;
    public function cancel(string $id): bool;
    public function clear(): void;
    public function all(): array;
    public function restore(QueueSnapshot $snapshot): void;
    public function size(): int;
    public function statistics(): QueueStatistics;
}
