Class AsyncScatterGather<TRequest, TResponse, TResult>
- Namespace
- PatternKit.Messaging.Routing
- Assembly
- PatternKit.Core.dll
Async scatter-gather with pluggable completion strategy, per-branch error isolation, and concurrent fan-out using Task.WhenAll.
public sealed class AsyncScatterGather<TRequest, TResponse, TResult>
Type Parameters
TRequestThe fan-out request type.
TResponseThe per-recipient response type.
TResultThe aggregated result type.
- Inheritance
-
AsyncScatterGather<TRequest, TResponse, TResult>
- Inherited Members
Methods
Create(string)
Creates a new async scatter-gather builder.
public static AsyncScatterGather<TRequest, TResponse, TResult>.Builder Create(string name = "async-scatter-gather")
Parameters
namestring
Returns
- AsyncScatterGather<TRequest, TResponse, TResult>.Builder
DispatchAsync(Message<TRequest>, MessageContext?, CancellationToken)
Fans out message to all recipients concurrently, waits per strategy,
and aggregates the results using concurrent fan-out.
public ValueTask<AsyncScatterGatherResult<TResponse, TResult>> DispatchAsync(Message<TRequest> message, MessageContext? context = null, CancellationToken cancellationToken = default)
Parameters
messageMessage<TRequest>contextMessageContextcancellationTokenCancellationToken
Returns
- ValueTask<AsyncScatterGatherResult<TResponse, TResult>>