Expand description
Conditional requests and rate-limit back-off, as a transport decorator.
ConditionalTransport wraps any HttpTransport and:
- remembers the
ETagof every successful GET and sends it back asIf-None-Match; a304is answered from the cached body (so callers see a normal 200) and, on GitHub, costs no rate limit; - reads each host’s rate-limit headers – interpreted per API family,
because the six products do not mean the same thing by them (see
[
rate_observation]) – and, once a host says “none left”, refuses further requests to it until the reset time instead of hammering it (Error::RateLimited); - exposes a short human note (
ConditionalTransport::rate_note) when a host is close to its limit, for the TUI’s status line.
Every client is rebuilt per refresh in the TUI, so the cache lives here (one shared instance), not in the clients.
Structs§
Functions§
- shared_
network_ transport - The process-wide caching network transport (created on first use).
- shared_
rate_ note - The shared transport’s rate note, without creating the transport.