Interface IConsumer<TEvent>
- Namespace
- ReflectionEventing
- Assembly
- ReflectionEventing.dll
Defines a contract for a consumer that can handle a specific event type.
public interface IConsumer<in TEvent>
Type Parameters
TEvent
The type of the event that the consumer can handle.
Remarks
Implementations of this interface are expected to provide a mechanism to consume a specific event type asynchronously.
Methods
ConsumeAsync(TEvent, CancellationToken)
Consumes the specified event asynchronously.
Task ConsumeAsync(TEvent payload, CancellationToken cancellationToken)
Parameters
payload
TEventThe event to consume.
cancellationToken
CancellationTokenA cancellation token that can be used to cancel the operation.
Returns
- Task
A task that represents the asynchronous operation.