<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Contracts;

use PpPhp\Core\Platform\Event\EventEnvelope;

interface EventBusInterface
{
    public function dispatch(EventInterface|string $event, array $payload = [], array $metadata = []): EventEnvelope;
    public function listen(string $eventName, mixed $listener, int $priority = 0): void;
    public function listeners(string $eventName): array;
}
