Last active
June 7, 2017 09:24
-
-
Save universal/bfcf6b7368801692198eeb0ab4d70ff4 to your computer and use it in GitHub Desktop.
This file contains 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
finished = true | |
timer = EM::PeriodicTimer.new(5) do | |
if finished | |
finished = false | |
method = http.post :body => { data: { serial_no: serial } } | |
method.errback { $stderr.puts 'Can\'t connect to cloud'; finished = true } | |
method.callback do | |
finished = true | |
p method.response_header.status | |
p method.response_header | |
p method.response | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment