Documentation ¶
Overview ¶
Package circuitbreaker provides support for circuit breaker pattern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircuitBreaker ¶
type CircuitBreaker interface {
Execute(f func() (interface{}, error), opts ...Option) (interface{}, error)
}
CircuitBreaker represents Circuit Breaker pattern mechanism.
type DefaultCircuitBreaker ¶
type DefaultCircuitBreaker struct{}
DefaultCircuitBreaker is default quark-go implementation of Circuit Breaker pattern.
func (DefaultCircuitBreaker) Execute ¶
func (cb DefaultCircuitBreaker) Execute(f func() (interface{}, error), opts ...Option) (interface{}, error)
Execute implements Circuit Breaker pattern for function f. Default settings are: 3 attempts (1 failure + 3 retries), 5 second sleep time between retries.
Click to show internal directories.
Click to hide internal directories.