Module: Unbreakable::Decorators::Timeout

Defined in:
lib/unbreakable/decorators/timeout.rb

Overview

Catches timeouts and retries with exponential backoff. To configure:

scraper.configure do |c|
  c.datastore.retry_limit = 5 # the maximum number of retries
  c.datastore.timeout_length = 60 # the timeout length
end

Class Method Summary collapse

Class Method Details

.extended(obj) ⇒ Object

Parameters:

  • object

    an object



14
15
16
17
18
19
# File 'lib/unbreakable/decorators/timeout.rb', line 14

def self.extended(obj)
  obj.class.instance_eval do
    configurable_attr :retry_limit, 5
    configurable_attr :timeout_length, 60
  end
end