<?php

namespace NoahVet\Reef\Domain\Security\Port;

use NoahVet\Reef\Domain\Security\Policy\PolicyResult;

/**
 * Outbound port: enqueues PolicyResult objects for asynchronous publishing.
 * Implementations may dispatch Symfony Messenger messages, RabbitMQ tasks, etc.
 *
 * Use this in BatchSyncPoliciesUseCase to avoid blocking on large subject sets.
 */
interface AsyncPolicyPublisherInterface
{
    /**
     * Enqueues a policy result for later asynchronous publishing.
     */
    public function enqueue(PolicyResult $result): void;

    /**
     * Flushes all queued results. Call at the end of a batch.
     * May be a no-op for implementations that dispatch immediately on enqueue.
     */
    public function flush(): void;
}
