Beetle.check_rate_inc

You're seeing just the function check_rate_inc, go back to Beetle module for more information.
Link to this function

check_rate_inc(id, scale_ms, limit, increment)

View Source

Specs

check_rate_inc(
  id :: String.t(),
  scale_ms :: integer(),
  limit :: integer(),
  increment :: integer()
) ::
  {:allow, count :: integer()}
  | {:deny, limit :: integer()}
  | {:error, reason :: any()}

Same as check_rate/3, but allows the increment number to be specified. This is useful for limiting apis which have some idea of 'cost', where the cost of each hit can be specified.

Link to this function

check_rate_inc(backend, id, scale_ms, limit, increment)

View Source

Specs

check_rate_inc(
  backend :: atom(),
  id :: String.t(),
  scale_ms :: integer(),
  limit :: integer(),
  increment :: integer()
) ::
  {:allow, count :: integer()}
  | {:deny, limit :: integer()}
  | {:error, reason :: any()}

Same as check_rate_inc/4, but allows specifying a backend.