Packages

object TokenBucket

Source
Throttle.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TokenBucket
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def local[F[_]](capacity: Int, refillEvery: FiniteDuration)(implicit F: Sync[F], clock: Clock[F]): F[TokenBucket[F]]

    Creates an in-memory TokenBucket.

    Creates an in-memory TokenBucket.

    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.