View Source Regulator.Limit behaviour (Regulator v0.6.0)

Provides a behaviour for defining new limit algorithms

Summary

Callbacks

The initial limit.

Creates a new limit configuration.

Recalculates the new limit based on the previous limit, the most recent window, and the configuration for the limit. Must return the limit configuration with the new limit in a tuple.

Callbacks

@callback initial(term()) :: pos_integer()

The initial limit.

@callback new(term()) :: term()

Creates a new limit configuration.

Link to this callback

update(term, pos_integer, t)

View Source
@callback update(term(), pos_integer(), Regulator.Window.t()) :: {term(), pos_integer()}

Recalculates the new limit based on the previous limit, the most recent window, and the configuration for the limit. Must return the limit configuration with the new limit in a tuple.