Created
November 11, 2014 16:29
-
-
Save alyraz/80fbba29acd66852ce4f 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 get_avail_info (requests) | |
avail_info = [] | |
avail_info = requests.map { | |
Thread.new { hit_api(request) }.map(&:value) | |
} | |
p avail_info | |
# requests.map(&:request).each do |request| | |
# puts "hitting API" | |
# avail_info << Thread.new{ hit_api(request)} | |
# end | |
# avail_info | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment