LinKit.Resilience 1.2.1

dotnet add package LinKit.Resilience --version 1.2.1
                    
NuGet\Install-Package LinKit.Resilience -Version 1.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LinKit.Resilience" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LinKit.Resilience" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="LinKit.Resilience" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LinKit.Resilience --version 1.2.1
                    
#r "nuget: LinKit.Resilience, 1.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LinKit.Resilience@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LinKit.Resilience&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=LinKit.Resilience&version=1.2.1
                    
Install as a Cake Tool

LinKit.Resilience

NuGet

LinKit.Resilience provides an explicit async execution pipeline with retries, per-attempt timeout, optional circuit breaker, configurable transient-error filtering, and TimeProvider support for deterministic tests.

Install

dotnet add package LinKit.Resilience

Execute an operation

using LinKit.Core.Resilience;
using LinKit.Resilience;

var options = new ResilienceOptions
{
    MaxRetries = 2, // additional attempts after the first call
    RetryDelay = TimeSpan.FromMilliseconds(200),
    MaxRetryDelay = TimeSpan.FromSeconds(3),
    Backoff = BackoffType.Exponential,
    Timeout = TimeSpan.FromSeconds(5),
    BreakerFailureThreshold = 5,
    BreakerDurationSeconds = 30,
    ShouldRetry = exception => exception is HttpRequestException
};

var response = await ResiliencePipeline.ExecuteAsync(
    "inventory-api",
    cancellationToken => inventoryClient.GetAsync(productId, cancellationToken),
    options,
    cancellationToken);

The order is retry loop, circuit-breaker check, per-attempt timeout, then the action. A successful attempt resets the breaker. MaxRetries = 2 permits up to three attempts. A zero breaker threshold disables the breaker.

Cancellation and timeout

Caller cancellation is propagated and is not retried. A timeout cancels the token passed to the action and reports TimeoutException when the action responds to cancellation. An action that ignores its token may continue running after the pipeline times out; do not use this as a mechanism to forcibly stop non-cooperative work.

Retries can repeat side effects. Use only for operations that are idempotent or protected by an idempotency key, and configure ShouldRetry narrowly for transient errors. Circuit breaker state is held in a process-wide registry keyed by string; use unique, stable keys for independent dependencies.

DI registration

AddLinKitResilience() is available for service registration/composition. The pipeline itself is invoked explicitly with ResiliencePipeline.ExecuteAsync; adding the package does not automatically wrap CQRS handlers or apply attributes to requests.

Native AOT

The pipeline uses delegates and does not require dynamic code generation in its direct execution path. Validate the full app and provider composition with trimming/AOT analyzers and publish for the deployment RID.

License

MIT. See the repository license.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 49 10/31/2026
1.2.0 53 10/30/2026
1.1.0 78 10/22/2026
1.0.0 90 10/20/2026