DistributedCachePollyDecorator 1.0.0
See the version list below for details.
dotnet add package DistributedCachePollyDecorator --version 1.0.0
NuGet\Install-Package DistributedCachePollyDecorator -Version 1.0.0
<PackageReference Include="DistributedCachePollyDecorator" Version="1.0.0" />
paket add DistributedCachePollyDecorator --version 1.0.0
#r "nuget: DistributedCachePollyDecorator, 1.0.0"
// Install DistributedCachePollyDecorator as a Cake Addin #addin nuget:?package=DistributedCachePollyDecorator&version=1.0.0 // Install DistributedCachePollyDecorator as a Cake Tool #tool nuget:?package=DistributedCachePollyDecorator&version=1.0.0
DistributedCachePollyDecorator
What Does This Package Do?
With this package you can inject Polly policy behaviours to the IDistributedCache interface. Right now it enables you to have a circuitbreaker policy that enables you to fail fast in case you Redis is down or your app runs into connection errors.
How to use the package:
Just add a 'AddDistributedCacheDecorator' call in your Startup.cs / any other place where you do your registrations
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
// your settings for Redis
services.AddStackExchangeRedisCache(options =>
{
options.Configuration = "localhost:6379,allowAdmin=true,DefaultDatabase=1";
});
// Decorate the inferface with a simple circuit breaker
services.AddDistributedCacheDecorator(new CircuitBreakerSettings()
{
DurationOfBreak = TimeSpan.FromMinutes(5),
ExceptionsAllowedBeforeBreaking = 2
});
// OR decorate it with an advanced one: (don't add both)
services.AddDistributedCacheDecorator(new CircuitBreakerAdvancedSettings()
{
DurationOfBreak = TimeSpan.FromMinutes(5),
FailureThreshold = 0.5,
MinimumThroughput = 100,
SamplingDuration = TimeSpan.FromMinutes(2)
});
}
Install Package
dotnet add package DistributedCachePollyDecorator --version 1.0.0
Or go to https://www.nuget.org/packages/DistributedCachePollyDecorator/
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
-
net5.0
- Microsoft.Extensions.Caching.Abstractions (>= 5.0.0)
- Microsoft.Extensions.DependencyInjection (>= 5.0.1)
- Microsoft.Extensions.Http.Polly (>= 5.0.1)
- Polly (>= 7.2.1)
- Scrutor (>= 3.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.