Table of Contents

Class TimeoutPipelineExtensions

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
Excalibur.Dispatch.dll

Extension methods for adding timeout middleware to the dispatch pipeline.

public static class TimeoutPipelineExtensions
Inheritance
TimeoutPipelineExtensions
Inherited Members

Methods

UseTimeout(IDispatchBuilder)

Adds timeout middleware to the dispatch pipeline.

public static IDispatchBuilder UseTimeout(this IDispatchBuilder builder)

Parameters

builder IDispatchBuilder

The dispatch builder.

Returns

IDispatchBuilder

The builder for fluent configuration.

Remarks

The timeout middleware enforces a maximum execution duration for downstream handlers. If the handler does not complete within the configured timeout, an OperationCanceledException is thrown.

Timeout services must be registered separately in the DI container. This method only adds the middleware to the pipeline.

Recommended pipeline order:

builder.UseExceptionMapping()
       .UseTimeout()          // Enforce timeout early
       .UseAuthentication()
       .UseAuthorization()
       .UseValidation()
       .UseRetry();