Interface IGracefulDegradationService
- Namespace
- Excalibur.Dispatch.Resilience.Polly
- Assembly
- Excalibur.Dispatch.Resilience.Polly.dll
Graceful degradation framework with multiple service levels.
public interface IGracefulDegradationService
- Extension Methods
Properties
CurrentLevel
Gets the current degradation level.
DegradationLevel CurrentLevel { get; }
Property Value
- DegradationLevel
The active degradation level for the service.
Methods
ExecuteWithDegradationAsync<T>(DegradationContext<T>, CancellationToken)
Executes an operation with graceful degradation.
Task<T> ExecuteWithDegradationAsync<T>(DegradationContext<T> context, CancellationToken cancellationToken)
Parameters
contextDegradationContext<T>The degradation context describing fallback strategies.
cancellationTokenCancellationTokenA token that is observed for cancellation.
Returns
- Task<T>
A task that completes with the operation result.
Type Parameters
TThe type returned by the primary or fallback operations.
GetMetrics()
Gets degradation metrics.
DegradationMetrics GetMetrics()
Returns
- DegradationMetrics
The current degradation metrics.
SetLevel(DegradationLevel, string)
Manually sets the degradation level.
void SetLevel(DegradationLevel level, string reason)
Parameters
levelDegradationLevelThe level to apply.
reasonstringThe reason for the manual override.