aboutsummaryrefslogtreecommitdiffstats
path: root/toys/brhute-rb/spike/emhttp_pipelining.rb
blob: 8730e11d98a4727834211f159b82025f7d9d23cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'eventmachine'
require 'em-http'

EventMachine.run do
  conn = EventMachine::HttpRequest.new('http://www.igvita.com/')
  
  pipe1 = conn.get :keepalive => true # request "/" root path
  pipe2 = conn.get :path => '/about/'
  pipe3 = conn.get :path => '/tata/'

  pipe1.callback { }
  pipe2.callback { }
  pipe3.callback { }
end