lib/resque/plugins/exponential_backoff.rb in resque-retry-0.0.5 vs lib/resque/plugins/exponential_backoff.rb in resque-retry-0.0.6
- old
+ new
@@ -1,9 +1,8 @@
module Resque
module Plugins
- ##
# If you want your job to retry on failure using a varying delay, simply
# extend your module/class with this module:
#
# class DeliverSMS
# extend Resque::Plugins::ExponentialBackoff
@@ -36,26 +35,23 @@
# end
#
module ExponentialBackoff
include Resque::Plugins::Retry
- ##
# Defaults to the number of delays in the backoff strategy.
#
# @return [Number] maximum number of retries
def retry_limit
@retry_limit ||= backoff_strategy.length
end
- ##
# Selects the delay from the backoff strategy.
#
# @return [Number] seconds to delay until the next retry.
def retry_delay
backoff_strategy[retry_attempt] || backoff_strategy.last
end
- ##
# @abstract
# The backoff strategy is used to vary the delay between retry attempts.
#
# @return [Array] array of delays. index = retry attempt
def backoff_strategy
\ No newline at end of file