TokenBucket

org.http4s.server.middleware.Throttle$.TokenBucket$
See theTokenBucket companion trait

Attributes

Companion:
trait
Source:
Throttle.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

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.

Attributes

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.

Source:
Throttle.scala