kit: github.com/go-kit/kit/circuitbreaker Index | Files

package circuitbreaker

import "github.com/go-kit/kit/circuitbreaker"

Package circuitbreaker implements the circuit breaker pattern.

Circuit breakers prevent thundering herds, and improve resiliency against intermittent errors. Every client-side endpoint should be wrapped in a circuit breaker.

We provide several implementations in this package, but if you're looking for guidance, Gobreaker is probably the best place to start. It has a simple and intuitive API, and is well-tested.

Index

Package Files

doc.go gobreaker.go handy_breaker.go hystrix.go

func Gobreaker Uses

func Gobreaker(cb *gobreaker.CircuitBreaker) endpoint.Middleware

Gobreaker returns an endpoint.Middleware that implements the circuit breaker pattern using the sony/gobreaker package. Only errors returned by the wrapped endpoint count against the circuit breaker's error count.

See http://godoc.org/github.com/sony/gobreaker for more information.

func HandyBreaker Uses

func HandyBreaker(cb breaker.Breaker) endpoint.Middleware

HandyBreaker returns an endpoint.Middleware that implements the circuit breaker pattern using the streadway/handy/breaker package. Only errors returned by the wrapped endpoint count against the circuit breaker's error count.

See http://godoc.org/github.com/streadway/handy/breaker for more information.

func Hystrix Uses

func Hystrix(commandName string) endpoint.Middleware

Hystrix returns an endpoint.Middleware that implements the circuit breaker pattern using the afex/hystrix-go package.

When using this circuit breaker, please configure your commands separately.

See https://godoc.org/github.com/afex/hystrix-go/hystrix for more information.

Package circuitbreaker imports 6 packages (graph) and is imported by 16 packages. Updated 2017-02-23. Refresh now. Tools for package owners.