TokenBucket

object TokenBucket
Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def local[F[_]](capacity: Int, refillEvery: FiniteDuration)(implicit F: Temporal[F]): F[TokenBucket[F]]

Creates an in-memory TokenBucket.

Creates an in-memory TokenBucket.

Value Params
capacity

the number of tokens the bucket can hold and starts with.

refillEvery

the frequency with which to add another token if there is capacity spare.

Returns

A task to create the TokenBucket.