module EveBadger::Throttle

Public Class Methods

disable() click to toggle source

disable request throttling

# File lib/eve_badger/throttle.rb, line 6
def self.disable
  SlowWeb.reset
end
enable_custom(requests_per_second) click to toggle source

set a custom rate limit if ccp has granted your application an exception

# File lib/eve_badger/throttle.rb, line 17
def self.enable_custom(requests_per_second)
  SlowWeb.reset
  SlowWeb.limit(EveBadger.default_tq_domain, requests_per_second, 1)
  SlowWeb.limit(EveBadger.default_sisi_domain, requests_per_second, 1)
end
enable_default() click to toggle source

enables the default rate limit of 30 requests per second

# File lib/eve_badger/throttle.rb, line 11
def self.enable_default
  SlowWeb.limit(EveBadger.default_tq_domain, 30, 1)
  SlowWeb.limit(EveBadger.default_sisi_domain, 30, 1)
end
enabled?() click to toggle source

test if request throttling is currently enabled

# File lib/eve_badger/throttle.rb, line 24
def self.enabled?
 if SlowWeb.get_limit(EveBadger.default_tq_domain) || SlowWeb.get_limit(EveBadger.default_sisi_domain)
   true
 else
   false
 end
end