A token bucket that doesn't exceed a given bound.
A token bucket that doesn't exceed a given bound.
This is threadsafe, and does not require further synchronization. The token bucket starts empty.
A leaky bucket expires tokens after approximately ttl
time.
A leaky bucket expires tokens after approximately ttl
time.
Thus, a bucket left alone will empty itself.
The (approximate) time after which a token will expire.
The number of reserve tokens over the TTL
period. That is, every ttl
has reserve
tokens in addition to
the ones added to the bucket.
A leaky bucket expires tokens after approximately ttl
time.
A leaky bucket expires tokens after approximately ttl
time.
Thus, a bucket left alone will empty itself.
The (approximate) time after which a token will expire.
The number of reserve tokens over the TTL
period. That is, every ttl
has reserve
tokens in addition to
the ones added to the bucket.
The current time in milliseconds