diff --git a/lib/Logitar.EventSourcing/IEventHandler.cs b/lib/Logitar.EventSourcing/IEventHandler.cs new file mode 100644 index 0000000..abff606 --- /dev/null +++ b/lib/Logitar.EventSourcing/IEventHandler.cs @@ -0,0 +1,16 @@ +namespace Logitar.EventSourcing; + +/// +/// Represents a handler for a specific event. +/// +/// The type of the event. +public interface IEventHandler where TEvent : IEvent +{ + /// + /// Handles the specified event. + /// + /// The event to handle. + /// The cancellation token. + /// The asynchronous operation. + Task HandleAsync(TEvent @event, CancellationToken cancellationToken = default); +}