Skip to content

Instantly share code, notes, and snippets.

@workmad3
Forked from universal/timer.rb
Last active June 7, 2017 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workmad3/694243fc7eeb0bad72be3832f41284ee to your computer and use it in GitHub Desktop.
Save workmad3/694243fc7eeb0bad72be3832f41284ee to your computer and use it in GitHub Desktop.
def start_request
method = http.post :body => { data: { serial_no: serial } }
method.errback do
yield
$stderr.puts 'Can\'t connect to cloud'
end
method.callback do
yield
p method.response_header.status
p method.response_header
p method.response
end
end
end
timer = EventMachine::Timer.new(5) do
start_request do
timer = EventMachine::Timer.new(5)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment