Expand description
Transfer configuration, rate limiting, and bounded-concurrency driver.
This module is the foundation for concurrent object transfers and bandwidth limiting. It provides:
TransferConfig— how many objects to transfer in parallel and an optional aggregate byte-rate cap.RateLimiter— a zero-dependency async token bucket built ontokio::time, shareable across tasks viaArc.run_concurrent— a generic bounded-concurrency driver that runs up toconcurrencyasync operations in flight and returns the first error.
Nothing here changes the existing (sequential) push / fetch loops yet; the
stores merely carry a TransferConfig so later gates can wire these
primitives into their transfer loops.
Structs§
- Blocking
Rate Limiter - A synchronous token-bucket rate limiter for the store-to-store sync path.
- Rate
Limiter - An async token-bucket rate limiter that throttles aggregate transfer throughput.
- Transfer
Config - Configuration for object transfers: how many to run in parallel, an optional aggregate byte-rate cap, and whether to tune those adaptively.
Enums§
- Adaptive
Policy - Whether (and how) a transfer adaptively tunes its concurrency / byte-rate.
Functions§
- classify_
error - Classifies a
StoreErrorfor the adaptive controller’s congestion signal. - run_
adaptive - Runs
opoveritemswith the in-flight window sized togate.ceiling()but the effective concurrency gated to the gate’s live limit: each item acquires aGatePermitbeforeopruns and holds it untilopcompletes. This is the adaptive sibling ofrun_concurrent: a background tick driver resizes the gate live, so the number of simultaneously-running ops tracks the controller’s limit while the buffer window stays at the ceiling. - run_
concurrent - Runs
opoveritemswith at mostconcurrencyoperations in flight, collecting their results in completion-independent order and returning the first error encountered (remaining in-flight work is cancelled).