-
Notifications
You must be signed in to change notification settings - Fork 187
Draft Specification for V3
Yoshiyuki Mineo edited this page Dec 28, 2024
·
3 revisions
- Use interface
type CircuitBreaker[T any] interface
- Make all the conditions of state transitions customizable
- Replace ReadyToTrip with ReadyToOpen
- Add ReadyToClose to specify the condition of the transition from Half-Open to Close
- Add ReadyToReopen to specify the condition of the transition from Half-Open to Open
type Settings struct {
Name string
Interval time.Duration
Timeout time.Duration
ReadyToOpen func(counts Counts) bool
ReadyToClose func(counts Counts) bool
ReadyToReopen func(counts Counts) bool
OnStateChange func(name string, from State, to State)
IsSuccessful func(err error) bool
}