From 7a06873556faa89ba5b5d64800f875aa997ac0ab Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Sat, 29 Nov 2025 14:29:01 -0500 Subject: [PATCH] Added `IEventHandler`. --- lib/Logitar.EventSourcing/IEventHandler.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/Logitar.EventSourcing/IEventHandler.cs 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); +}