SkillAgentSearch skills...

Finity

Finity is a .NET Core resilience and Fault tolerance library that allows developers to extend IHttpClientFactory such as Retry, Circuit Breaker, Caching, Authentication and, Bulkhead Isolation.

Install / Use

/learn @savariamir/Finity
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

.NET 5 CI

Fault tolerance library designed for .Net core

Finity is a .NET Core resilience and Fault tolerance library that allows developers to extend IHttpClientFactory such as Retry, Circuit Breaker, Caching, Authentication and, Bulkhead Isolation.

Finity is a lightweight fault tolerance library designed to isolate access to remote resources and services. In a distributed environment, calls to remote resources and services can fail due to transient faults, such as slow network connections, timeouts, or the resources being overcommitted or temporarily unavailable.

Using Finity with HttpClient factory from ASPNET Core

Finity extends .Net Core HttpClient Factory to avoid transienting faults.

Installing via NuGet

Install-Package Finity

Retry

services
    .AddHttpClient("finity")
    .WithRetry(options =>
    {
        options.SleepDurationRetry = TimeSpan.FromMilliseconds(100);
        options.RetryCount = 3;
    });

Circuit Breaker

services
    .AddHttpClient("finity")
    .WithCircuitBreaker(options =>
    {
        options.SuccessAllowedBeforeClosing = 1;
        options.DurationOfBreak = TimeSpan.FromMilliseconds(100);
        options.ExceptionsAllowedBeforeBreaking = 2;
    });

Caching

services
    .AddHttpClient("finity")
    .WithCache(options =>
    {
        options.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(1);
    });

Bulkhead

services
    .AddHttpClient("finity")
    .WithBulkhead(options =>
    {
        options.MaxConcurrentCalls = 100;
    });

Related Skills

View on GitHub
GitHub Stars20
CategoryDevelopment
Updated1y ago
Forks1

Languages

C#

Security Score

65/100

Audited on Feb 18, 2025

No findings