All Projects → GokGokalp → Luffy

GokGokalp / Luffy

Luffy is a simple resilience and transient-fault handling library

Projects that are alternatives of or similar to Luffy

perseverance
Make your functions 💪 resilient and 🚥 fail-fast to 💩 failures or ⌚ delays
Stars: ✭ 12 (-36.84%)
Mutual labels:  resiliency, retry, circuit-breaker
Semian
🐒 Resiliency toolkit for Ruby for failing fast
Stars: ✭ 976 (+5036.84%)
Mutual labels:  circuit-breaker, resiliency
Toxy
Hackable HTTP proxy for resiliency testing and simulated network conditions
Stars: ✭ 2,698 (+14100%)
Mutual labels:  retry, resiliency
Safely
Safely is a Clojure's circuit-breaker library for handling retries in an elegant declarative way.
Stars: ✭ 152 (+700%)
Mutual labels:  retry, circuit-breaker
resiliency
A modern PHP library that allows you to make resilient calls to external services 🔁
Stars: ✭ 79 (+315.79%)
Mutual labels:  resiliency, circuit-breaker
resilience4clj-circuitbreaker
Resilience4Clj circuit breaker lets you decorate a function call (usually with a potential of external failure) with a safety mechanism to interrupt the propagation of failures.
Stars: ✭ 40 (+110.53%)
Mutual labels:  retry, circuit-breaker
Riprova
Versatile async-friendly library to retry failed operations with configurable backoff strategies
Stars: ✭ 106 (+457.89%)
Mutual labels:  retry, resiliency
request-on-steroids
An HTTP client ✨ with retry, circuit-breaker and tor support 📦 out-of-the-box
Stars: ✭ 19 (+0%)
Mutual labels:  retry, circuit-breaker
Retry
♻️ The most advanced interruptible mechanism to perform actions repetitively until successful.
Stars: ✭ 294 (+1447.37%)
Mutual labels:  retry, resiliency
Istio
Connect, secure, control, and observe services.
Stars: ✭ 28,970 (+152373.68%)
Mutual labels:  circuit-breaker, resiliency
Spring Cloud Alibaba
Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
Stars: ✭ 20,934 (+110078.95%)
Mutual labels:  circuit-breaker
Failsafe
Fault tolerance and resilience patterns for the JVM
Stars: ✭ 3,541 (+18536.84%)
Mutual labels:  retry
Reattempt
🤞 Give your functions another chance
Stars: ✭ 570 (+2900%)
Mutual labels:  retry
Steeltoe
Steeltoe .NET Core Components: CircuitBreaker, Configuration, Connectors, Discovery, Logging, Management, and Security
Stars: ✭ 612 (+3121.05%)
Mutual labels:  circuit-breaker
Elixirretry
Simple Elixir macros for linear retry, exponential backoff and wait with composable delays
Stars: ✭ 314 (+1552.63%)
Mutual labels:  retry
Cloud Design Patterns
Prescriptive Architecture Guidance for Cloud Applications
Stars: ✭ 484 (+2447.37%)
Mutual labels:  resiliency
Simmy
Simmy is a chaos-engineering and fault-injection tool, integrating with the Polly resilience project for .NET
Stars: ✭ 313 (+1547.37%)
Mutual labels:  resiliency
Opossum
Node.js circuit breaker - fails fast ⚡️
Stars: ✭ 473 (+2389.47%)
Mutual labels:  circuit-breaker
Retry
because you should never give up, at least not on the first try
Stars: ✭ 303 (+1494.74%)
Mutual labels:  retry
Guard
NOT MAINTAINED! A generic high performance circuit breaker & proxy server written in Go
Stars: ✭ 745 (+3821.05%)
Mutual labels:  circuit-breaker

Luffy


alt tag

Luffy is a simple resilience and transient-fault handling library for .NET

NuGet version

NuGet Packages

PM> Install-Package Luffy

Features:

  • Luffy provides circuit breaker feature
  • Luffy provides retry mechanism with back-off (linear and exponentially)
  • Luffy provides fallback feature

Usages:


Sample usage for the circuit breaker:

async Task<double> CircuitBreakerSample(double amount, string from, string to)
{
    double currentRate = await Luffy.Instance
                        .UseCircuitBreaker(new CircuitBreakerOptions(key: "CurrencyConverterSampleAPI",
                                                                     exceptionThreshold: 5,
                                                                     successThresholdWhenCircuitBreakerHalfOpenStatus: 5,
                                                                     durationOfBreak: TimeSpan.FromSeconds(5)))
                        .ExecuteAsync<double>(async () => {
                            // Some API calls...
                            double rate = await CurrencyConverterSampleAPI(amount, from, to);

                            return rate;
                        });

    return currentRate;
}

Sample usage for the retry mechanism:

async Task<double> RetryMechanismSample(double amount, string from, string to)
{
    double currentRate = await Luffy.Instance
                        .UseRetry(new RetryMechanismOptions(RetryPolicies.Linear,
                                                            retryCount: 3,
                                                            interval: TimeSpan.FromSeconds(5)))
                        .ExecuteAsync<double>(async () => {
                            // Some API calls...
                            double rate = await CurrencyConverterSampleAPI(amount, from, to);

                            return rate;
                        });

    return currentRate;
}

Sample usage for the retry mechanism and fallback scenario:

async Task<double> RetryMechanismWithFallbackSample(double amount, string from, string to)
{
    double currentRate = await Luffy.Instance
                        .UseRetry(new RetryMechanismOptions(RetryPolicies.Linear,
                                                            retryCount: 3,
                                                            interval: TimeSpan.FromSeconds(5)))
                        .ExecuteAsync<double>(async () => {
                            // Some API calls...
                            double rate = await CurrencyConverterSampleAPI(amount, from, to);

                            return rate;
                        }, async () => {
                            // Some fallback scenario.
                            double rate = 100;

                            return await Task.FromResult(rate);                                    
                        });

    return currentRate;
}

Samples:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].