It refills against the clock rather than on a timer, so it costs nothing
while idle and cannot drift. Sharing one across a fleet needs a store, a
clock all the machines agree on, and an answer for what happens when the
store is down, none of which this package can pick for you.
Callers that have to wait are served in the order they arrived, so a steady
stream of new calls cannot starve the one that has been waiting longest.
Belongs outside the bulkhead: waiting for a token should not hold a
concurrency slot.
A token bucket, in this process and no other.
It refills against the clock rather than on a timer, so it costs nothing while idle and cannot drift. Sharing one across a fleet needs a store, a clock all the machines agree on, and an answer for what happens when the store is down, none of which this package can pick for you.
Callers that have to wait are served in the order they arrived, so a steady stream of new calls cannot starve the one that has been waiting longest.
Belongs outside the bulkhead: waiting for a token should not hold a concurrency slot.