Class: CMDx::RateLimit::Quota

Inherits:
Data
  • Object
show all
Defined in:
lib/cmdx/rate_limit.rb

Overview

Inputs for a limiter callable (CMDx::Limiters or limiter: Proc).

Instance Attribute Summary collapse

Instance Attribute Details

#cost ⇒ Numeric (readonly)

units charged when admitted (:leaky_bucket)

Returns:

  • (Numeric) —

    the current value of cost



40
41
42
# File 'lib/cmdx/rate_limit.rb', line 40

def cost
  @cost
end

#limiter ⇒ Symbol, #call (readonly)

resolved strategy spec

Returns:

  • (Symbol, #call) —

    the current value of limiter



40
41
42
# File 'lib/cmdx/rate_limit.rb', line 40

def limiter
  @limiter
end

#max ⇒ Integer (readonly)

capacity or window max from the declaration

Returns:

  • (Integer) —

    the current value of max



40
41
42
# File 'lib/cmdx/rate_limit.rb', line 40

def max
  @max
end

#options ⇒ Hash{Symbol => Object} (readonly)

frozen declaration options

Returns:

  • (Hash{Symbol => Object}) —

    the current value of options



40
41
42
# File 'lib/cmdx/rate_limit.rb', line 40

def options
  @options
end

#per ⇒ Integer (readonly)

window or leak interval in seconds

Returns:

  • (Integer) —

    the current value of per



40
41
42
# File 'lib/cmdx/rate_limit.rb', line 40

def per
  @per
end

#store_key ⇒ String (readonly)

base store key (limiters may append suffixes)

Returns:

  • (String) —

    the current value of store_key



40
41
42
# File 'lib/cmdx/rate_limit.rb', line 40

def store_key
  @store_key
end

#task ⇒ Task (readonly)

task being admitted

Returns:

  • (Task) —

    the current value of task



40
41
42
# File 'lib/cmdx/rate_limit.rb', line 40

def task
  @task
end