Skip to content

Commit 0f0c938

Browse files
schighclaude
andcommitted
Add logo and backoff strategy images to README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 66c37d7 commit 0f0c938

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# circuit
1+
<p align="center">
2+
<img src="_img/logo.png" alt="circuit" />
3+
</p>
24

3-
A highly-tunable circuit breaker for Go.
5+
<p align="center">
6+
A highly-tunable circuit breaker for Go.
7+
</p>
48

59
Circuit implements the [circuit breaker](https://www.martinfowler.com/bliki/CircuitBreaker.html) design pattern with gradual recovery via probabilistic throttling, type-safe generics, and zero background goroutines.
610

@@ -236,14 +240,6 @@ During the throttled state, the breaker probabilistically sheds requests using a
236240

237241
### Built-in Strategies
238242

239-
| Strategy | Behavior |
240-
|----------|----------|
241-
| `Linear` (default) | Steady decrease in blocking probability |
242-
| `Logarithmic` | High blocking initially, rapid decrease after midpoint |
243-
| `Exponential` | Rapid initial decrease, gradual easing |
244-
| `EaseInOut` | Smooth S-curve transition |
245-
| `JitteredLinear` | Linear with ±5 random jitter to prevent thundering herd |
246-
247243
```go
248244
b, _ := circuit.NewBreaker(
249245
circuit.WithName("api-gateway"),
@@ -252,6 +248,34 @@ b, _ := circuit.NewBreaker(
252248
)
253249
```
254250

251+
#### Linear (default)
252+
253+
Steady, proportional decrease in blocking probability.
254+
255+
![Linear estimation](_img/linear.png)
256+
257+
#### Logarithmic
258+
259+
High blocking initially, rapid decrease after the midpoint.
260+
261+
![Logarithmic estimation](_img/logarithmic.png)
262+
263+
#### Exponential
264+
265+
Rapid initial decrease, gradual easing toward full throughput.
266+
267+
![Exponential estimation](_img/exponential.png)
268+
269+
#### Ease-In-Out
270+
271+
Smooth S-curve — high blocking early, steep drop at midpoint, gentle finish.
272+
273+
![Ease-In-Out estimation](_img/easeinout.png)
274+
275+
#### JitteredLinear
276+
277+
Linear with ±5 random jitter to prevent thundering herd effects during recovery.
278+
255279
### Custom Strategies
256280

257281
Implement your own `EstimationFunc`:

0 commit comments

Comments
 (0)