Table of Contents

Method Create

Namespace
LMKit.Agents.Resilience
Assembly
LM-Kit.NET.dll

Create(T, Func<Exception, bool>)

Creates a fallback policy with a static value.

public static FallbackPolicy<T> Create(T fallbackValue, Func<Exception, bool> shouldHandle = null)

Parameters

fallbackValue T
shouldHandle Func<Exception, bool>

Returns

FallbackPolicy<T>

Create(Func<ResilienceContext, CancellationToken, Task<T>>, Func<Exception, bool>)

Creates a fallback policy with a fallback action.

public static FallbackPolicy<T> Create(Func<ResilienceContext, CancellationToken, Task<T>> fallbackAction, Func<Exception, bool> shouldHandle = null)

Parameters

fallbackAction Func<ResilienceContext, CancellationToken, Task<T>>
shouldHandle Func<Exception, bool>

Returns

FallbackPolicy<T>