Expand description
How many streams this server holds open at once, and how many of them one caller may hold.
com.atproto.sync.subscribeRepos is the route whose answer does not end. Every other route’s cost is bounded by
crate::MAX_CONCURRENT_REQUESTS, which releases its permit once the
response head is sent — which for a stream is immediately, and for the
next hour of that stream’s life is nothing at all. What each one keeps
after that is a task and a frame in flight per subscriber, and the
routes are public, so without a bound of their own a caller can open them
until the process runs out of memory.
Two bounds, for the reason crate::rate_limit’s own doc gives for its
two: a total, which is the resource actually shared, and a per-address
one, so a single caller cannot spend the whole total on its own. A slot is
held for the life of the stream rather than the life of the request, which
is what makes it a bound on concurrency rather than on arrival rate.
Structs§
- Counts 🔒
- Subscriber
Limit - The two bounds, and what is currently held against them.
- Subscriber
Slot - One open stream’s claim on
SubscriberLimit, released when it drops.
Constants§
- DEFAULT_
MAX_ SUBSCRIBERS - How many streams this server holds open across every caller.
- DEFAULT_
MAX_ SUBSCRIBERS_ PER_ CALLER - How many of those one caller address may hold.