Table of Contents

Class TimeoutManager

Namespace
Excalibur.Dispatch.Resilience.Polly
Assembly
Excalibur.Dispatch.Resilience.Polly.dll

Implementation of centralized timeout management.

public class TimeoutManager : ITimeoutManager
Inheritance
TimeoutManager
Implements
Inherited Members
Extension Methods

Constructors

TimeoutManager(IOptions<TimeoutManagerOptions>, ILogger<TimeoutManager>)

Initializes a new instance of the TimeoutManager class.

public TimeoutManager(IOptions<TimeoutManagerOptions> options, ILogger<TimeoutManager> logger)

Parameters

options IOptions<TimeoutManagerOptions>

The timeout manager options.

logger ILogger<TimeoutManager>

The logger instance.

Properties

DefaultTimeout

Gets the default timeout for all operations.

public TimeSpan DefaultTimeout { get; }

Property Value

TimeSpan

The fallback timeout applied when no named override exists.

Methods

GetTimeout(string)

Gets the configured timeout for the specified operation.

public TimeSpan GetTimeout(string operationName)

Parameters

operationName string

The name of the operation.

Returns

TimeSpan

The configured timeout for the operation.

IsSlowOperation(string, TimeSpan)

Checks if an operation is approaching its timeout.

public bool IsSlowOperation(string operationName, TimeSpan elapsed)

Parameters

operationName string

The operation name.

elapsed TimeSpan

The elapsed time.

Returns

bool

True if the operation is slow.

RegisterTimeout(string, TimeSpan)

Registers a custom timeout for a specific operation.

public void RegisterTimeout(string operationName, TimeSpan timeout)

Parameters

operationName string

The name of the operation.

timeout TimeSpan

The timeout duration.