Skip to content

Instantly share code, notes, and snippets.

@brainopia
Created October 8, 2010 17:15
Show Gist options
  • Save brainopia/617147 to your computer and use it in GitHub Desktop.
Save brainopia/617147 to your computer and use it in GitHub Desktop.
require 'em-synchrony'
require 'em-synchrony/em-http'
EventMachine.synchrony do
multi = EventMachine::Synchrony::Multi.new
multi.add :a, EventMachine::HttpRequest.new('http://ya.ru/').aget
EventMachine.add_timer(2) do
multi.perform; EventMachine.stop
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment