Regulator v0.1.0 Regulator.Limit behaviour View Source
Provides a behaviour for defining new limit algorithms
Link to this section 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.
Link to this section Callbacks
Specs
initial(term()) :: pos_integer()
The initial limit.
Specs
Creates a new limit configuration.
Specs
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.