Corvus.Retry
2.0.0
dotnet add package Corvus.Retry --version 2.0.0
NuGet\Install-Package Corvus.Retry -Version 2.0.0
<PackageReference Include="Corvus.Retry" Version="2.0.0" />
<PackageVersion Include="Corvus.Retry" Version="2.0.0" />
<PackageReference Include="Corvus.Retry" />
paket add Corvus.Retry --version 2.0.0
#r "nuget: Corvus.Retry, 2.0.0"
#:package Corvus.Retry@2.0.0
#addin nuget:?package=Corvus.Retry&version=2.0.0
#tool nuget:?package=Corvus.Retry&version=2.0.0
Corvus.Retry
Retry support for synchronous and asynchronous operations, and a self-restarting host for long-running tasks, with
pluggable retry policies and strategies. It targets netstandard2.0 and net10.0.
Corvus.Retry was written before Polly. For new code, we suggest you look at Polly.
Usage
Retriable wraps a synchronous or asynchronous operation, and runs it again if it throws:
using Corvus.Retry;
using Corvus.Retry.Policies;
using Corvus.Retry.Strategies;
SomeResult result = Retriable.Retry(() => GetSomething());
await Retriable.RetryAsync(() => DoSomethingAsync());
// Up to 5 tries, 1 second apart. Pass your own IRetryPolicy to retry only some exceptions.
SomeResult result2 = Retriable.Retry(
() => GetSomething(),
CancellationToken.None,
new Linear(TimeSpan.FromSeconds(1), 5),
new AnyExceptionPolicy());
RetryTask.Factory and RetryTask<T>.Factory work like Task.Factory, with retry:
Task<SomeResult> task = RetryTask<SomeResult>.Factory.StartNew(() => GetSomething(), new Count(5), new AnyExceptionPolicy());
ReliableTaskRunner keeps a long-running operation going, restarting it after a failure, until you stop it:
ReliableTaskRunner runner = ReliableTaskRunner.Run(cancellationToken => ProcessMessagesAsync(cancellationToken));
await runner.StopAsync();
- Policies (
IRetryPolicy) decide whether a failure is retried:AnyExceptionPolicy,DoNotRetryPolicy,AggregatePolicy, or your own. - Strategies (
IRetryStrategy) decide how many tries are made and the delay between them:Count,DoNotRetry,Linear,IncrementalandBackoff, or your own.
More information
- Documentation and samples
- Changelog, including the behaviour changes in 2.0
- Issues
Corvus.Retry is sponsored by endjin and available under the Apache 2.0 license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Corvus.Retry:
| Package | Downloads |
|---|---|
|
Corvus.Extensions.CosmosClient
Package Description |
|
|
Corvus.Leasing.Abstractions
Package Description |
|
|
Corvus.Leasing.Azure
Package Description |
|
|
Ais.Net.Receiver
Recieves Network streams of NMEA sentences and can decode AIS message types 1,2,3,5,18,19,24 Part 0, and 24 Part 1 into an IObservable of IAisMessage (See Ais.Net.Models). Sponsored by endjin. |
|
|
Corvus.CosmosClient.Extensions
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
See https://github.com/corvus-dotnet/Corvus.Retry/blob/main/CHANGELOG.md for the changes in each release, including the behaviour changes in 2.0.