- require 'rubygems'
- require 'eventmachine'
- require 'em-http-request'
- EM.run do
- def foo
- http = EM::HttpRequest.new('http://www.google.com').get
- http.callback do |get|
- get.response
- end
- end
- puts foo # A Proc
- fail "didn't work" if !foo.include?("<!doctype html>")
- # foo is returning a Proc, I want it to return the http response.
- end