CircuitBreakerInterceptor constructor

CircuitBreakerInterceptor({
  1. int failureThreshold = 5,
  2. Duration breakDuration = const Duration(seconds: 30),
  3. DateTime clock()?,
})

Implementation

CircuitBreakerInterceptor(
    {this.failureThreshold = 5,
    this.breakDuration = const Duration(seconds: 30),
    DateTime Function()? clock})
    : _clock = clock ?? DateTime.now {
  if (failureThreshold < 1 || breakDuration <= Duration.zero) {
    throw ArgumentError('Invalid circuit options.');
  }
}