Corvus.Retry 2.0.0

dotnet add package Corvus.Retry --version 2.0.0
                    
NuGet\Install-Package Corvus.Retry -Version 2.0.0
                    
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="Corvus.Retry" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Corvus.Retry" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Corvus.Retry" />
                    
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 Corvus.Retry --version 2.0.0
                    
#r "nuget: Corvus.Retry, 2.0.0"
                    
#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 Corvus.Retry@2.0.0
                    
#: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=Corvus.Retry&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Corvus.Retry&version=2.0.0
                    
Install as a Cake Tool

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, Incremental and Backoff, or your own.

More information

Corvus.Retry is sponsored by endjin and available under the Apache 2.0 license.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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.

Version Downloads Last Updated
2.0.0 333 10/31/2026
1.0.7 17,142 5/3/2023
1.0.2 36,033 3/16/2021
1.0.1 13,569 2/11/2021
1.0.0 22,721 7/13/2020
0.5.0 1,285 7/10/2020
0.4.0 19,496 9/6/2019
0.3.0 797 9/6/2019
0.2.0 3,535 8/21/2019
0.1.1 814 8/21/2019
0.1.0 856 8/21/2019

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.