Token Bucket
Hard · Concurrency
Capacity cap, start full, refill refill per elapsed tick, cap at cap. requests are ticks (non-decreasing). Return how many are allowed. Write allowed(_:_:_:).
Next: Clone an Array
Hard · Concurrency
Capacity cap, start full, refill refill per elapsed tick, cap at cap. requests are ticks (non-decreasing). Return how many are allowed. Write allowed(_:_:_:).
Next: Clone an Array