diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 7b1afef..f5cee26 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -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: