Registry / utility / rubyist-circuitbreaker

rubyist-circuitbreaker

JSON →
library2.2.1+incompatiblegogounverified

Implements the Circuit Breaker pattern to wrap function calls and monitor for failures and timeouts, with support for threshold and consecutive breakers.

go get github.com/rubyist/circuitbreaker
INSTALL
IMPORT
SIG · RUBYIST-CIRCUITBRE
R
rubyist-circuitbreaker
utilitygov2.2.1+incompatible
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

circuitbreaker
github.com/rubyist/circuitbreaker

Shows how to create a threshold breaker and simulate failures until it trips.

package main import ( "fmt" "time" "github.com/rubyist/circuitbreaker" ) func main() { // Example: create a threshold breaker that trips after 5 failures cb := circuitbreaker.NewThresholdBreaker(5) for i := 0; i < 10; i++ { err := cb.Call(func() error { return fmt.Errorf("simulated error") }, time.Second) if err != nil { fmt.Println("Call failed:", err) } if cb.Tripped() { fmt.Println("Breaker tripped!") break } } }
Debug
Known issues
breakingVersion 2.2.1+incompatible indicates it uses Go modules but may have breaking changes from v1.
fix
Use a specific version or check the changelog for migration guides.
affects: >=2.0.0
Upgrade
Version history
2.2.1+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
rubyist-circuitbreaker — go get rubyist-circuitbreaker · libregistry