An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 1.2% on proxy.golang.org
Top 0.3% dependent packages on proxy.golang.org
Top 0.3% dependent repos on proxy.golang.org
Top 2.4% forks on proxy.golang.org
Top 1.0% docker downloads on proxy.golang.org

proxy.golang.org : github.com/rubyist/circuitbreaker

Package circuit implements the Circuit Breaker pattern. It will wrap a function call (typically one which uses remote services) and monitors for failures and/or time outs. When a threshold of failures or time outs has been reached, future calls to the function will not run. During this state, the breaker will periodically allow the function to run and, if it is successful, will start running the function again. Circuit includes three types of circuit breakers: A Threshold Breaker will trip when the failure count reaches a given threshold. It does not matter how long it takes to reach the threshold and the failures do not need to be consecutive. A Consecutive Breaker will trip when the consecutive failure count reaches a given threshold. It does not matter how long it takes to reach the threshold, but the failures do need to be consecutive. When wrapping blocks of code with a Breaker's Call() function, a time out can be specified. If the time out is reached, the breaker's Fail() function will be called. Other types of circuit breakers can be easily built by creating a Breaker and adding a custom TripFunc. A TripFunc is called when a Breaker Fail()s and receives the breaker as an argument. It then returns true or false to indicate whether the breaker should trip. The package also provides a wrapper around an http.Client that wraps all of the http.Client functions with a Breaker.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/rubyist/circuitbreaker
Keywords: circuit-breakers , circuitbreaker , go
License: MIT
Latest release: about 8 years ago
First release: over 10 years ago
Namespace: github.com/rubyist
Dependent packages: 163
Dependent repositories: 424
Stars: 1,050 on GitHub
Forks: 119 on GitHub
Docker dependents: 9
Docker downloads: 286,385
See more repository details: repos.ecosyste.ms
Last synced: 5 months ago

    Loading...
    Readme
    Loading...