Created
December 21, 2010 15:30
-
-
Save aeden/750065 to your computer and use it in GitHub Desktop.
Example of using Retryable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'retryable' | |
class Test | |
def self.run | |
Retryable.retry_on(RuntimeError, 2, Proc.new { fix }) do | |
puts "trying something broken" | |
raise RuntimeError | |
end | |
end | |
def self.fix | |
puts "trying to fix" | |
end | |
end | |
Test.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment