Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| README.md | 5 years ago | |
| breaker.go | 5 years ago | |
The circuit-breaker resiliency pattern for golang.
Creating a breaker takes three parameters:
b := breaker.New(3, 1, 5*time.Second)
for {
result := b.Run(func() error {
// communicate with some external service and
// return an error if the communication failed
return nil
})
switch result {
case nil:
// success!
case breaker.ErrBreakerOpen:
// our function wasn't run because the breaker was open
default:
// some other error
}
}
类似 Grafana 可接入多种数据源,Grafana 擅长可视化,夜莺擅长告警管理
Go SQL Text Python PLSQL other