liveBook · Manning

Closed state

As explained in Python Concurrency with asyncio

The closed state is the circuit-breaker state in which requests are sent normally to the protected service.

The closed state is the circuit breaker's normal path: requests reach the protected service, and successful responses return normally. It contrasts with the open state, which fails calls immediately after repeated service errors. section 10.3.5

A simple circuit breaker uses the closed state to:

  • Send requests normally while failures remain below the configured limit. section 10.3.5
  • Record failures within a time window and open the circuit after the maximum is exceeded. section 10.3.5

Breaker in action

A slow callback times out twice, causing the circuit to open; subsequent calls fail fast. After five seconds, the circuit closes and requests resume until failures trip it again.

How Python Concurrency with asyncio covers it

How deep it goes
Defines normal operation, failure counting, and reopening after a reset interval while skipping detailed half-open behavior.
Examples
Demonstrates a timed-out asynchronous callback that opens after two failures, fails fast, and later closes.
What you can do after
Operate/configure a circuit breaker with timeouts, failure limits, time windows, and reset intervals.
How it connects
Connects circuit breaker pattern with open state, half-open state, timeouts, and failure thresholds.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Python Concurrency with asyncio. The section links point to the parts of the book it draws on.