module
Mosquito::RateLimiter
Defined in:
mosquito/rate_limiter.crInstance Method Summary
-
#increment_run_count : Nil
Increments the run counter.
-
#increment_run_count_by : Int32
How much the run counter should be incremented by.
-
#maxed_rate_for_window? : Bool
Has the run count exceeded the ceiling for the current window?
-
#metadata : Metadata
Storage hash for rate limit data.
-
#rate_limited? : Bool
Should this job be cancelled? If not, update the rate limit metadata.
-
#update_window_start : Nil
Resets the run count and logs the start of window.
-
#window_expires_at : Time | Nil
When does the current rate limit window expire? Returns nil if the window is already expired.
-
#window_start : Time | Nil
Calculates the start of the rate limit window.
Instance Method Detail
def increment_run_count_by : Int32
#
How much the run counter should be incremented by. Implemented as a dynamic method so that it can easily be calculated by some other metric, eg api calls to a third party library.
def window_expires_at : Time | Nil
#
When does the current rate limit window expire? Returns nil if the window is already expired.