-
-
Save Jarred-Sumner/e09a2eecfcefbcb3ab36 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
def self.process_requests! | |
@thread = Thread.new do | |
loop do | |
if self.requests.count > 0 | |
puts 'Starting request' | |
log = self.requests.pop | |
begin | |
RestClient.post URL, { :log => log, :api_key => self.api_key } | |
puts "#{log}" | |
rescue => e | |
p e | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment