using System.Collections.Generic; using Svrnty.CQRS.Events.Abstractions.EventStore; using System.Threading; using System.Threading.Tasks; namespace Svrnty.CQRS.Events.Abstractions.EventStore; /// /// Service for emitting events from command handlers. /// Events are stored and delivered to subscribers based on their subscriptions. /// public interface IEventEmitter { /// /// Emit an event with the specified correlation ID. /// /// The event to emit. /// Cancellation token. /// The sequence number assigned to this event. Task EmitAsync(ICorrelatedEvent @event, CancellationToken cancellationToken = default); /// /// Emit multiple events with the same correlation ID in a batch. /// /// The events to emit. /// Cancellation token. /// Dictionary mapping event IDs to their sequence numbers. Task> EmitBatchAsync(IEnumerable events, CancellationToken cancellationToken = default); }