Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:3169206
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
require 'celluloid'
require 'net/http'
 
class MarkupPutter
include Celluloid
 
def initialize(url)
@url = url
end
 
def output(markup_future)
puts "#{@url}"
puts "#{markup_future.value}"
puts "----------------------------"
end
def get_markup
Net::HTTP.get(URI.parse(@url))
end
end
 
websites = ["http://google.com/", "http://yahoo.com/", "http://rubysource.com/", "http://tumblr.com/"]
 
websites.each do |website|
mp = MarkupPutter.new website
markup_future = mp.future :get_markup
mp.output markup_future
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.