TokenBucket

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

Attributes

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

Members list

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 parameters

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.

Attributes

Returns

A task to create the TokenBucket.

Source
Throttle.scala