View Source Nostrum.Store.RatelimitBucket.ETS (Nostrum v0.8.0)
Stores ratelimit buckets via :ets
.
If programmatic access to the ETS table is needed, please use the table/0
function.
Please do not use this module directly, apart from special functions such as
table/0
. Use Nostrum.Store.RatelimitBucket
to call the configured
mapping instead.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Clean up bucket entries older than age
milliseconds.
Set up the store's ETS table.
Look up the most relevant ratelimiter bucket for the given route.
Start the supervisor.
Retrieve the ETS table reference used for the store.
Update an existing routes remaining calls.
Set up a new ratelimiter bucket from the given arguments.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec cleanup(pos_integer()) :: non_neg_integer()
Clean up bucket entries older than age
milliseconds.
Set up the store's ETS table.
@spec lookup(Nostrum.Store.RatelimitBucket.route()) :: Nostrum.Store.RatelimitBucket.bucket() | nil
Look up the most relevant ratelimiter bucket for the given route.
Start the supervisor.
@spec table() :: :ets.table()
Retrieve the ETS table reference used for the store.
@spec update( Nostrum.Store.RatelimitBucket.route(), Nostrum.Store.RatelimitBucket.remaining() ) :: :ok
Update an existing routes remaining calls.
@spec update( Nostrum.Store.RatelimitBucket.route(), Nostrum.Store.RatelimitBucket.remaining(), Nostrum.Store.RatelimitBucket.reset_time(), Nostrum.Store.RatelimitBucket.latency() ) :: :ok
Set up a new ratelimiter bucket from the given arguments.