Karta.Limits.Cleaner (Karta v1.0.0)

Keeps the shared rate-limit table (Karta.Limits) bounded: every :interval milliseconds (default 30,000) it deletes the counters whose window has ended and the counters closest to expiry above the table's bound. No interval (nil) starts it without a timer, for tests.

A failed run is logged and the next one tries again: the limits themselves refuse while the database cannot be read, and this process never takes the application down.

Options: name (also the process name), interval, and expire (a function of no arguments, default Karta.Limits.expire/0).

Summary

Functions

Returns a specification to start this module under a supervisor.

Does one run now, as the interval does. Option: now.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

run(opts \\ [])

@spec run(keyword()) :: %{expired: non_neg_integer(), evicted: non_neg_integer()}

Does one run now, as the interval does. Option: now.

start_link(opts)