Skip to main content

Module traffic

Module traffic 

Source
Expand description

Shared state for traffic-control plugins whose logic spans the upstream call — concurrency limits, circuit breakers, and response caching.

A featherbit node occupies a single graph position, but these behaviors need to act both before the upstream (acquire a slot / check the breaker / look up the cache) and after it (release / observe the status / store the response). The idiomatic featherbit expression is a pair of nodes wired around upstream, both configured with the same id and sharing an entry in one of these process-wide registries — the same “two phases, one shared key” shape proxy-rewrite uses for request/response.

All three registries are lock-light concurrent maps keyed by the plugin’s configured id, so multiple routes can maintain independent state and a pair on one route shares exactly one entry.

Structs§

BreakerRegistry
Circuit-breaker registry for api-breaker node pairs.
BreakerState
State of one circuit breaker (shared by an api-breaker check/observe pair).
CacheEntry
A cached upstream response.
CacheRegistry
Response cache for proxy-cache lookup/store node pairs.
ConnRegistry
Per-key in-flight request counters for limit-conn.
TrafficRegistries
The three registries, held in PluginResources.