dotnet-cqrs/Svrnty.CQRS.Events.Abstractions/Delivery/IEventDeliveryService.cs

22 lines
831 B
C#

using System.Threading;
using Svrnty.CQRS.Events.Abstractions.Delivery;
using Svrnty.CQRS.Events.Abstractions.EventStore;
using System.Threading.Tasks;
namespace Svrnty.CQRS.Events.Abstractions.Delivery;
/// <summary>
/// Service responsible for delivering events to subscribers.
/// Handles filtering, delivery mode logic, and terminal event detection.
/// </summary>
public interface IEventDeliveryService
{
/// <summary>
/// Deliver an event to all interested subscribers.
/// </summary>
/// <param name="event">The event to deliver.</param>
/// <param name="sequence">The sequence number assigned to this event.</param>
/// <param name="cancellationToken">Cancellation token.</param>
Task DeliverEventAsync(ICorrelatedEvent @event, long sequence, CancellationToken cancellationToken = default);
}