Interface IMessageAggregator<TResult>
- Namespace
- DotCompute.Abstractions.Messaging
- Assembly
- DotCompute.Abstractions.dll
Aggregates responses from multiple requests into a single result.
public interface IMessageAggregator<TResult> : IAsyncDisposable
Type Parameters
TResultThe aggregated result type.
- Inherited Members
Properties
AggregatedResult
Gets a task that completes when aggregation is complete or times out.
Task<TResult> AggregatedResult { get; }
Property Value
- Task<TResult>
ExpectedCount
Gets the number of expected responses.
int ExpectedCount { get; }
Property Value
IsComplete
Gets a value indicating whether all expected responses have been received.
bool IsComplete { get; }
Property Value
ReceivedCount
Gets the number of received responses.
int ReceivedCount { get; }
Property Value
Methods
AddResponseAsync<TResponse>(TResponse, CancellationToken)
Adds a response to the aggregation.
Task<bool> AddResponseAsync<TResponse>(TResponse response, CancellationToken cancellationToken = default) where TResponse : IResponseMessage
Parameters
responseTResponseThe response to add.
cancellationTokenCancellationTokenCancellation token.
Returns
Type Parameters
TResponseThe response type.
Cancel()
Cancels the aggregation and completes with partial results.
void Cancel()
MarkFailed(Guid, Exception)
Marks a specific request as failed.
void MarkFailed(Guid correlationId, Exception exception)