Skip to content

Retry N times before Fail

Paul Bergeron edited this page May 2, 2013 · 2 revisions

Rhod supports retying up to N times. By default it uses a logarithmic backoff:

require 'open-uri'
require 'rhod'

address = "http://google.com"

Rhod.create_profile(:five_attempts, retries: 5)

Rhod.with_five_attempts(address) do |url|
   open(url).read
end