withFailureThreshold


Description:

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

Sets consecutive failure threshold.

Breaker transitions from CLOSED to OPEN when this threshold is reached.

Parameters:

n

failure threshold.

Returns:

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