Neuro.AppToolkit.Resilience
0.1.0-preview.2
dotnet add package Neuro.AppToolkit.Resilience --version 0.1.0-preview.2
NuGet\Install-Package Neuro.AppToolkit.Resilience -Version 0.1.0-preview.2
<PackageReference Include="Neuro.AppToolkit.Resilience" Version="0.1.0-preview.2" />
<PackageVersion Include="Neuro.AppToolkit.Resilience" Version="0.1.0-preview.2" />
<PackageReference Include="Neuro.AppToolkit.Resilience" />
paket add Neuro.AppToolkit.Resilience --version 0.1.0-preview.2
#r "nuget: Neuro.AppToolkit.Resilience, 0.1.0-preview.2"
#:package Neuro.AppToolkit.Resilience@0.1.0-preview.2
#addin nuget:?package=Neuro.AppToolkit.Resilience&version=0.1.0-preview.2&prerelease
#tool nuget:?package=Neuro.AppToolkit.Resilience&version=0.1.0-preview.2&prerelease
Neuro.AppToolkit.Resilience
Keeps app code working when the network, a server or the device misbehaves. It works in any .NET 10 app, has no package dependencies, and is trim and AOT safe. MAUI apps add Neuro.AppToolkit.Resilience.Maui to feed in connectivity and the app lifecycle.
The package has four parts:
| Part | What it gives you |
|---|---|
| Pipelines | Timeout, retry, circuit breaker, concurrency gate and fallback, composed into one pipeline. Plus an HttpClient handler and three presets. |
| Coordination | KeyedAsyncLock, SingleFlight, Debouncer and Throttler. |
| Tasks | TaskObserver (.Tasks namespace), which runs work and publishes immutable snapshots of its state. |
| App awareness | Network and lifecycle signals, and ConnectionSupervisor (.Connections namespace) for long-lived connections. |
A first pipeline
using Neuro.AppToolkit.Resilience;
ResiliencePipeline Pipeline = new ResiliencePipelineBuilder()
.AddTimeout(TimeSpan.FromSeconds(30))
.AddRetry(new RetryOptions
{
MaxAttempts = 4,
Backoff = Backoff.DecorrelatedJitter(TimeSpan.FromMilliseconds(200)),
MaxDelay = TimeSpan.FromSeconds(10),
WaitForNetwork = true,
})
.AddCircuitBreaker(ResiliencePipelineRegistry.Default.GetOrAddCircuitBreaker("content-api"))
.AddTimeout(TimeSpan.FromSeconds(10))
.Build();
byte[] Bytes = await Pipeline.ExecuteAsync(
async Token => await Http.GetByteArrayAsync(Url, Token),
CancellationToken);
The first strategy added is the outermost one. Here a 30-second budget covers every attempt, and each attempt gets 10 seconds. When the success path runs through a pipeline it allocates nothing.
Or start from a preset: ResiliencePresets.Interactive, ResiliencePresets.Network or ResiliencePresets.Background.
HTTP
HttpClient Http = new(new ResilientHttpHandler { InnerHandler = new HttpClientHandler() });
The handler retries transient failures (408, 429, 500, 502, 503, 504 and connection errors) and honors Retry-After. Requests that are not idempotent, such as POST, are only retried when they opt in with ResilientHttpHandler.AllowRetryOption.
Telemetry
Every strategy reports to System.Diagnostics.Metrics and ActivitySource under the name Neuro.AppToolkit.Resilience, and to the optional IResilienceListener of its ResilienceEnvironment for logging.
Testing
Everything takes its clock, jitter and signals from a ResilienceEnvironment, so a test passes new ResilienceEnvironment { TimeProvider = FakeTime } and runs in fake time. The Neuro.AppToolkit.Resilience.Testing package has FakeNetworkStatus and FakeAppLifecycle; for fixed jitter, pass a Random subclass.
See the full guide.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Neuro.AppToolkit.Resilience:
| Package | Downloads |
|---|---|
|
Neuro.AppToolkit.Mvvm
MVVM building blocks for any .NET app, starting with BindableTask: a bindable, command-ready view of a Neuro.AppToolkit.Resilience TaskObserver. |
|
|
Neuro.AppToolkit.Resilience.Testing
Test doubles for Neuro.AppToolkit.Resilience: network and app lifecycle signals that tests switch by hand. |
|
|
Neuro.AppToolkit.Resilience.Maui
.NET MAUI connectivity and app lifecycle adapters for Neuro.AppToolkit.Resilience. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.2 | 97 | 10/28/2026 |