Skip to content

Instantly share code, notes, and snippets.

@tkrajcar
Created August 30, 2011 17:23
Show Gist options
  • Save tkrajcar/1181417 to your computer and use it in GitHub Desktop.
Save tkrajcar/1181417 to your computer and use it in GitHub Desktop.
begin
timeout(2) do
# do whatever
parsed = JSON.parse(open("http://derp.com/derpservice").read)
end
end
rescue
logger.debug "Timed out."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment