[#339] pool/tree: Configure circuit breaker parameters
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
parent
06ef257ddc
commit
d592bb931e
1 changed files with 12 additions and 0 deletions
|
@ -376,6 +376,18 @@ func (x *InitParameters) SetNetMapInfoSource(netMapInfoSource NetMapInfoSource)
|
|||
x.netMapInfoSource = netMapInfoSource
|
||||
}
|
||||
|
||||
// SetCircuitBreakerThreshold sets number of consecutive failed connection before
|
||||
// circuit is considered closed and therefore return error immediately.
|
||||
func (x *InitParameters) SetCircuitBreakerThreshold(circuitBreakerThreshold int) {
|
||||
x.circuitBreakerThreshold = circuitBreakerThreshold
|
||||
}
|
||||
|
||||
// SetCircuitBreakerDuration sets duration for circuit to be considered closed.
|
||||
// This effectively limits to one new connection try per duration.
|
||||
func (x *InitParameters) SetCircuitBreakerDuration(circuitBreakerDuration time.Duration) {
|
||||
x.circuitBreakerDuration = circuitBreakerDuration
|
||||
}
|
||||
|
||||
// GetNodes invokes eponymous method from TreeServiceClient.
|
||||
//
|
||||
// Can return predefined errors:
|
||||
|
|
Loading…
Add table
Reference in a new issue