Skip to content

Instantly share code, notes, and snippets.

@aeden
Created December 21, 2010 15:30
Show Gist options
  • Save aeden/750065 to your computer and use it in GitHub Desktop.
Save aeden/750065 to your computer and use it in GitHub Desktop.
Example of using Retryable
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