Carom.AspNetCore 1.1.0

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

Carom 🎱

A lean, fast, and safe resilience library for .NET

NuGet License .NET

Carom is a zero-dependency resilience library that enforces best practices by default. Named after the billiards shot where the ball bounces before reaching its target, Carom helps your code gracefully handle failures.

🎯 Why Carom?

  • Zero Dependencies (core packages)
  • Minimal Allocations (<100 bytes on hot path)
  • Safe by Default (mandatory decorrelated jitter)
  • Tiny Footprint (13KB core, 20KB extensions)
  • Fully Composable (all patterns work together)

📦 Packages

Package Version Size Purpose
Carom v1.3.0 13KB Core retry + timeout
Carom.Extensions v1.4.0 20KB Circuit Breaker, Fallback, Bulkhead, Rate Limiting
Carom.Http v1.0.0 11KB HTTP integration
Carom.AspNetCore v1.0.0 10KB ASP.NET Core health checks
Carom.EntityFramework v1.0.0 10KB EF Core retry
Carom.Telemetry.OpenTelemetry v1.0.0 9KB OpenTelemetry metrics

🚀 Quick Start

Installation

dotnet add package Carom
dotnet add package Carom.Extensions

Basic Usage

using Carom;

// Simple retry with exponential backoff
var result = await Carom.ShotAsync(() => api.CallAsync(), retries: 3);

// With timeout
var bounce = Bounce.Times(5).WithTimeout(TimeSpan.FromSeconds(30));
var data = await Carom.ShotAsync(() => apiClient.FetchAsync(), bounce);

Circuit Breaker

using Carom.Extensions;

var cushion = Cushion.ForService("payment-api")
    .OpenAfter(failures: 5, within: 10)
    .HalfOpenAfter(TimeSpan.FromSeconds(30));

var payment = await CaromCushionExtensions.ShotAsync(
    () => paymentApi.Charge(), 
    cushion);

Fallback

var config = await new Func<Task<AppConfig>>(() => configService.LoadAsync())
    .PocketAsync(AppConfig.Default);

Bulkhead

var dbCompartment = Compartment.ForResource("database")
    .WithMaxConcurrency(10)
    .Build();

var query = await CaromCompartmentExtensions.ShotAsync(
    () => db.QueryAsync(sql), 
    dbCompartment);

Rate Limiting

var apiThrottle = Throttle.ForService("external-api")
    .WithRate(100, TimeSpan.FromSeconds(1))
    .WithBurst(20)
    .Build();

var apiResult = await CaromThrottleExtensions.ShotAsync(
    () => apiClient.CallAsync(), 
    apiThrottle);

🎓 Patterns

Pattern Class Purpose
Retry Carom Exponential backoff with jitter
Timeout Bounce.WithTimeout() Operation timeout
Circuit Breaker Cushion Prevent cascade failures
Fallback Pocket/PocketAsync Graceful degradation
Bulkhead Compartment Concurrency control
Rate Limiting Throttle Token bucket algorithm

�� Documentation

🤝 Contributing

Contributions welcome! Please read our contributing guidelines first.

📄 License

MPL-2.0 - see LICENSE for details.

🙏 Acknowledgments

Built with the Baryo.Dev philosophy: zero dependencies, minimal allocations, safe by default.


Made with ❤️ by Baryo.Dev

📊 Performance

Carom is significantly faster than Polly v8:

  • 175,000x faster startup (0.02ns vs 3,857ns)
  • 15x faster hot path (10.9ns vs 167.8ns)
  • 4.8x faster async operations (45ns vs 216ns)

See detailed benchmarks for complete analysis.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 65 2/25/2026
1.0.2 108 1/19/2026
1.0.1 99 1/5/2026
1.0.0 94 12/30/2025