GithubHelp home page GithubHelp logo

bnupaladin / hystrix.dotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from travix-international/hystrix.dotnet

0.0 2.0 0.0 765 KB

A combination of circuit breaker and timeout. The .net version of the open source Hystrix library built by Netflix.

Home Page: https://travix-international.github.io/Hystrix.Dotnet/

License: MIT License

Shell 0.61% C# 99.39%

hystrix.dotnet's Introduction

Hystrix.Dotnet

A combination of circuit breaker and timeout. The .NET version of the open source Hystrix library built by Netflix.

Build Status .NET Version Coverage Status License

Why?

In order to isolate failure in one dependency from taking down another component. Whenever the circuit breaker opens it returns an exception or runs the fallback without burdening the failing system. It sends through a single request on a regular interval to see if the dependent system is back in business.

How to use

Circuit breakers are the main concept in Hystrix, and they are identifyable by a group and command key, which are arbitrary strings to support structuring and organizing the various circuit breakers we have in our application. Every circuit breaker can have its own configuration regarding its timeout, fallback mechanism, error threshold, etc.

Once we have a reference to a circuit breaker (represented by the IHystrixCommand interface), we can execute an operation through it using either the synchronous version:

T result = hystrixCommand.Execute<T>(() => myFunctionWithReturnTypeT());

Or use the async version:

T result = await hystrixCommand.ExecuteAsync<T>(() => myAsyncFunctionWithReturnTypeTaskT());

In the documentation you can find more examples, and details about creating commands and customizing the configuration.

Sample projects

In the samples directory you can find an example project illustrating the configuration of Hystrix for ASP.NET and ASP.NET Core.

Known issues

Unlike the original Hystrix implementation, the current .Net implementation doesn't use a way to limit the maximum number of concurrent requests per command. Using the ExecuteAsync method will make efficient use of the threadpool, so it's not entirely clear whether it will give us any benefits.

Neither are retries implemented at this moment.

hystrix.dotnet's People

Contributors

markvincze avatar jorritsalverda avatar 1kastner avatar discosultan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.