Skip to content

Commit 153124a

Browse files
committed
docs(engineering): §1 resilience suite + §5 module-layout refresh
- §1: append a sentence noting the resilience suite ships in 0.4 - §5: add middleware/resilience/ subpackage (bulkhead, budget, retry, _backoff) to the module tree; extend errors.py comment to mention NetworkError + RetryBudgetExhaustedError + BulkheadFullError
1 parent 91e7ca7 commit 153124a

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

planning/engineering.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This doc is the single distilled reference for `httpware` design rationale, prot
44

55
## 1. Project intent
66

7-
`httpware` is a thin opinionated wrapper around `httpx2`. It re-exports `httpx2.Request` and `httpx2.Response` as the public request/response surface and adds three things on top: typed response decoding (via a `ResponseDecoder` protocol; pydantic and msgspec are both opt-in extras as of 0.3.0), a middleware chain composed at client construction, and a status-keyed exception tree raised automatically on 4xx and 5xx. `AsyncClient(decoder=None)` defaults to constructing a `PydanticDecoder` and so requires the `pydantic` extra; callers can supply an explicit `decoder=` argument to escape the default.
7+
`httpware` is a thin opinionated wrapper around `httpx2`. It re-exports `httpx2.Request` and `httpx2.Response` as the public request/response surface and adds three things on top: typed response decoding (via a `ResponseDecoder` protocol; pydantic and msgspec are both opt-in extras as of 0.3.0), a middleware chain composed at client construction, and a status-keyed exception tree raised automatically on 4xx and 5xx. `AsyncClient(decoder=None)` defaults to constructing a `PydanticDecoder` and so requires the `pydantic` extra; callers can supply an explicit `decoder=` argument to escape the default. As of 0.4.0, the package ships a small resilience suite under `httpware.middleware.resilience` — a `Retry` middleware with a Finagle-style `RetryBudget`, plus a `Bulkhead` concurrency limiter — composed via the standard middleware chain.
88

99
The 0.1.0 release attempted to own a full abstraction over the underlying HTTP client. v0.2 walks that back: `httpx2` is part of the public surface.
1010

@@ -70,10 +70,16 @@ src/httpware/
7070
├── __init__.py # public exports
7171
├── py.typed
7272
├── client.py # AsyncClient
73-
├── errors.py # status-keyed exception tree (response: httpx2.Response)
73+
├── errors.py # status-keyed exception tree + NetworkError + RetryBudgetExhaustedError + BulkheadFullError
7474
├── middleware/
7575
│ ├── __init__.py # Middleware protocol, Next type, @before_request/@after_response/@on_error
76-
│ └── chain.py # compose(middleware, terminal) -> Next
76+
│ ├── chain.py # compose(middleware, terminal) -> Next
77+
│ └── resilience/
78+
│ ├── __init__.py # re-exports Bulkhead, Retry, RetryBudget
79+
│ ├── bulkhead.py # Bulkhead middleware (concurrency limiter)
80+
│ ├── budget.py # RetryBudget (Finagle-style token bucket)
81+
│ ├── retry.py # Retry middleware
82+
│ └── _backoff.py # full-jitter exponential backoff helper (private)
7783
├── decoders/
7884
│ ├── __init__.py # ResponseDecoder protocol
7985
│ ├── pydantic.py # PydanticDecoder (extra: pydantic)

0 commit comments

Comments
 (0)