Skip to content
expert

Challenge: a circuit breaker

Implement this from the stub. Hidden tests grade the behaviour you write, not the comments you leave.

Challenge: A Circuit Breaker

export interface CircuitBreakerOptions {
  failureThreshold: number
  resetTimeoutMs: number
  now: () => number
}

export class CircuitBreaker {
  async execute<T>(task: () => Promise<T>): Promise<T> {
    // Your implementation here
  }
}
challenge — implement from scratchCtrl+↵ submits · Ctrl+Shift+↵ runsstarter code