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
TEventThe 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
payloadTEventThe event to consume.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the operation.
Returns
- Task
A task that represents the asynchronous operation.