Skip to content

Instantly share code, notes, and snippets.

@jkeck
Created March 3, 2010 22:45
Show Gist options
  • Save jkeck/321136 to your computer and use it in GitHub Desktop.
Save jkeck/321136 to your computer and use it in GitHub Desktop.
<html>
<body>
<%= some_method %>
</body>
</html>
module ApplicationHelper
def some_method
begin
xml = Timeout::timeout(15) {
#some net http call that would take longer than 15 seconds
}
rescue Timeout::Error
return "The operation timed out"
end
xml
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment