Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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|
supervisor = MarkupPutter.supervise_as :mp, website
mp = Celluloid::Actor[:mp]
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.