From aff36865d5e738babdbf36f34fd0693b67bb3d90 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 Apr 2011 05:45:44 +0000 Subject: xepoll_thread_spawn: initial implementation Whee! This is going to be awesome. --- lib/rainbows/process_client.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/rainbows/process_client.rb') diff --git a/lib/rainbows/process_client.rb b/lib/rainbows/process_client.rb index bf6d20b..24132f5 100644 --- a/lib/rainbows/process_client.rb +++ b/lib/rainbows/process_client.rb @@ -46,4 +46,25 @@ module Rainbows::ProcessClient def set_input(env, hp) env[RACK_INPUT] = 0 == hp.content_length ? NULL_IO : IC.new(self, hp) end + + def process_pipeline(env, hp) + begin + set_input(env, hp) + env[REMOTE_ADDR] = kgio_addr + status, headers, body = APP.call(env.merge!(RACK_DEFAULTS)) + if 100 == status.to_i + write(EXPECT_100_RESPONSE) + env.delete(HTTP_EXPECT) + status, headers, body = APP.call(env) + end + write_response(status, headers, body, alive = hp.next?) + end while alive && env = pipeline_ready(hp) + alive or close + rescue => e + handle_error(e) + end + + # override this in subclass/module + def pipeline_ready + end end -- cgit v1.2.3-24-ge0c7