Table of Contents

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

TRequest

The fan-out request type.

TResponse

The per-recipient response type.

TResult

The 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

name string

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

message Message<TRequest>
context MessageContext
cancellationToken CancellationToken

Returns

ValueTask<AsyncScatterGatherResult<TResponse, TResult>>