Class FallbackOptions

Namespace
Kevlar
Assembly
Kevlar.dll

Configures notifications for an untyped fallback strategy.

public sealed class FallbackOptions
Inheritance
FallbackOptions
Inherited Members

Remarks

After a failure is selected for recovery, Kevlar records the fallback metric, invokes and awaits OnFallback, and then runs the recovery action. Notification failures are reported through OnCallbackError and do not skip recovery. Without an ambient clause or local handling override, fallback handles ordinary exceptions and ExecutionRejectedException instances while letting cancellation and fatal runtime exceptions propagate.

Constructors

FallbackOptions()

public FallbackOptions()

Properties

HandlesException

Setting this makes this fallback ignore the ambient When… handling clause and handle only the exceptions this predicate selects.

public Func<Exception, bool>? HandlesException { get; set; }

Property Value

Func<Exception, bool>

Remarks

The ambient clause is started with When… on a shield and continued with Or… on the builder it returns, and applies to every reactive strategy chained after it. This property replaces that clause for this strategy alone; it does not narrow it.

See Also

HandlesExceptionContext

Locally handles exceptions using execution context and strategy metadata.

public Func<HandlingEvent, bool>? HandlesExceptionContext { get; set; }

Property Value

Func<HandlingEvent, bool>

Name

An optional low-cardinality name used by strategy telemetry.

public string? Name { get; set; }

Property Value

string

OnFallback

Invoked and awaited before the recovery action. Return default from a synchronous callback.

public Func<FallbackEvent, ValueTask>? OnFallback { get; set; }

Property Value

Func<FallbackEvent, ValueTask>