Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
require 'async'
require 'async/barrier'
require 'open-uri'
def async_fetch(*urls)
barrier =
Async do do |url|
barrier.async { url, &:read }
end.tap { barrier.wait }
url = ''
puts async_fetch url, url, url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment