withSuccessThreshold


Description:

public Result<CircuitBreaker,Error> withSuccessThreshold (int n)

Sets success threshold needed to close from HALF_OPEN.

In HALF_OPEN, this many consecutive successes are required to return to CLOSED state.

Parameters:

n

success threshold.

Returns:

Result.ok(this breaker), or Result.error(CircuitBreakerError.INVALID_ARGUMENT) when n is not positive.