# File lib/rq-2.3.1/relayer.rb, line 203 def throttle rate = @min_sleep #--{{{ if Numeric === rate and rate > 0 if defined? @last_throttle_time and @last_throttle_time elapsed = Time.now - @last_throttle_time timeout = rate - elapsed if timeout > 0 timeout = timeout + rand(rate * 0.10) debug{ "throttle rate of <#{ rate }> exceeded - sleeping <#{ timeout }>" } sleep timeout end end @last_throttle_time = Time.now end yield #--}}} end