Ratelix.TokenBucket (ratelix v0.3.0)

View Source

Implements a Token Bucket rate limiter as a GenServer.

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

t()

@type t() :: %Ratelix.TokenBucket{
  capacity: pos_integer(),
  interval: pos_integer(),
  rate: pos_integer(),
  tokens: pos_integer()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.