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
optionsIOptions<TimeoutManagerOptions>The timeout manager options.
loggerILogger<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
operationNamestringThe 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
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)