Skip to content

Instantly share code, notes, and snippets.

@Jarred-Sumner
Created November 5, 2012 02:53
Show Gist options
  • Save Jarred-Sumner/e09a2eecfcefbcb3ab36 to your computer and use it in GitHub Desktop.
Save Jarred-Sumner/e09a2eecfcefbcb3ab36 to your computer and use it in GitHub Desktop.
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