View Source Nostrum.Store.RatelimitBucket.Mnesia (Nostrum v0.8.0)

Stores ratelimit buckets using Mnesia.

Please note that this module is only compiled if Mnesia is available on your system. See the Mnesia section of the State documentation for more information.

To retrieve the table name used by this cache, use table/0.

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 Mnesia table.

Look up the most relevant ratelimiter bucket for the given route.

Start the supervisor.

Retrieve the Mnesia table name used for the store.

Drop the table 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

Link to this function

child_spec(init_arg)

View Source (since 0.8.0)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

cleanup(age)

View Source (since 0.8.0)
@spec cleanup(pos_integer()) :: non_neg_integer()

Clean up bucket entries older than age milliseconds.

Link to this function

init(init_arg)

View Source (since 0.8.0)

Set up the store's Mnesia table.

Link to this function

lookup(route)

View Source (since 0.8.0)

Look up the most relevant ratelimiter bucket for the given route.

Link to this function

start_link(init_arg)

View Source (since 0.8.0)

Start the supervisor.

@spec table() :: atom()

Retrieve the Mnesia table name used for the store.

Link to this function

teardown()

View Source (since 0.8.0)
@spec teardown() :: {:atomic, :ok} | {:aborted, term()}

Drop the table used for the store.

Link to this function

update(route, remaining)

View Source (since 0.8.0)

Update an existing routes remaining calls.

Link to this function

update(route, remaining, reset_time, latency)

View Source (since 0.8.0)

Set up a new ratelimiter bucket from the given arguments.