Table of Contents

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

context DegradationContext<T>

The degradation context describing fallback strategies.

cancellationToken CancellationToken

A token that is observed for cancellation.

Returns

Task<T>

A task that completes with the operation result.

Type Parameters

T

The 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

level DegradationLevel

The level to apply.

reason string

The reason for the manual override.