about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-30 08:32:28 +0000
committerEric Wong <normalperson@yhbt.net>2011-01-04 16:21:17 -0800
commit4a76da1833922c74e147be5def9bfe04fd0c16a2 (patch)
tree7ee061ee23e7bff38110341a81ed7a315a0e373c
parented28feabd79697cb27722036622aeca1fbf0723d (diff)
coolio: rename deferred_response => response_pipe
For consistency with the EventMachine code
-rw-r--r--lib/rainbows/coolio.rb4
-rw-r--r--lib/rainbows/coolio/client.rb12
-rw-r--r--lib/rainbows/coolio/response_chunk_pipe.rb (renamed from lib/rainbows/coolio/deferred_chunk_response.rb)3
-rw-r--r--lib/rainbows/coolio/response_pipe.rb (renamed from lib/rainbows/coolio/deferred_response.rb)2
4 files changed, 10 insertions, 11 deletions
diff --git a/lib/rainbows/coolio.rb b/lib/rainbows/coolio.rb
index a9075cc..463bf0a 100644
--- a/lib/rainbows/coolio.rb
+++ b/lib/rainbows/coolio.rb
@@ -33,13 +33,13 @@ module Rainbows::Coolio
 
   autoload :Master, 'rainbows/coolio/master'
   autoload :ThreadClient, 'rainbows/coolio/thread_client'
-  autoload :DeferredChunkResponse, 'rainbows/coolio/deferred_chunk_response'
+  autoload :ResponsePipe, 'rainbows/coolio/response_pipe'
+  autoload :ResponseChunkPipe, 'rainbows/coolio/response_chunk_pipe'
   # :startdoc:
 end
 # :enddoc:
 require 'rainbows/coolio/heartbeat'
 require 'rainbows/coolio/server'
 require 'rainbows/coolio/core'
-require 'rainbows/coolio/deferred_response'
 require 'rainbows/coolio/client'
 Rainbows::Coolio.__send__ :include, Rainbows::Coolio::Core
diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb
index 7b41026..6360e2d 100644
--- a/lib/rainbows/coolio/client.rb
+++ b/lib/rainbows/coolio/client.rb
@@ -6,8 +6,8 @@ class Rainbows::Coolio::Client < Coolio::IO
   SF = Rainbows::StreamFile
   CONN = Rainbows::Coolio::CONN
   KATO = Rainbows::Coolio::KATO
-  DeferredResponse = Rainbows::Coolio::DeferredResponse
-  DeferredChunkResponse = Rainbows::Coolio::DeferredChunkResponse
+  ResponsePipe = Rainbows::Coolio::ResponsePipe
+  ResponseChunkPipe = Rainbows::Coolio::ResponseChunkPipe
 
   def initialize(io)
     CONN[self] = false
@@ -61,7 +61,7 @@ class Rainbows::Coolio::Client < Coolio::IO
 
   # queued, optional response bodies, it should only be unpollable "fast"
   # devices where read(2) is uninterruptable.  Unfortunately, NFS and ilk
-  # are also part of this.  We'll also stick DeferredResponse bodies in
+  # are also part of this.  We'll also stick ResponsePipe bodies in
   # here to prevent connections from being closed on us.
   def defer_body(io)
     @deferred = io
@@ -88,7 +88,7 @@ class Rainbows::Coolio::Client < Coolio::IO
     c = stream_response_headers(status, headers) if headers
     # we only want to attach to the Coolio::Loop belonging to the
     # main thread in Ruby 1.9
-    io = (c ? DeferredChunkResponse : DeferredResponse).new(io, self, body)
+    io = (c ? ResponseChunkPipe : ResponsePipe).new(io, self, body)
     defer_body(io.attach(LOOP))
   end
 
@@ -133,7 +133,7 @@ class Rainbows::Coolio::Client < Coolio::IO
 
   def on_write_complete
     case @deferred
-    when DeferredResponse then return
+    when ResponsePipe then return
     when NilClass # fall through
     else
       begin
@@ -172,7 +172,7 @@ class Rainbows::Coolio::Client < Coolio::IO
 
   def close_deferred
     case @deferred
-    when DeferredResponse, NilClass
+    when ResponsePipe, NilClass
     else
       begin
         @deferred.close
diff --git a/lib/rainbows/coolio/deferred_chunk_response.rb b/lib/rainbows/coolio/response_chunk_pipe.rb
index 6ced2e6..5e456e9 100644
--- a/lib/rainbows/coolio/deferred_chunk_response.rb
+++ b/lib/rainbows/coolio/response_chunk_pipe.rb
@@ -2,8 +2,7 @@
 # :enddoc:
 #
 # this is class is specific to Coolio for proxying IO-derived objects
-class Rainbows::Coolio::DeferredChunkResponse <
-      Rainbows::Coolio::DeferredResponse
+class Rainbows::Coolio::ResponseChunkPipe < Rainbows::Coolio::ResponsePipe
   def on_read(data)
     @client.write("#{data.size.to_s(16)}\r\n")
     @client.write(data)
diff --git a/lib/rainbows/coolio/deferred_response.rb b/lib/rainbows/coolio/response_pipe.rb
index 2f6f965..42483c2 100644
--- a/lib/rainbows/coolio/deferred_response.rb
+++ b/lib/rainbows/coolio/response_pipe.rb
@@ -3,7 +3,7 @@
 #
 # this is class is specific to Coolio for writing large static files
 # or proxying IO-derived objects
-class Rainbows::Coolio::DeferredResponse < Coolio::IO
+class Rainbows::Coolio::ResponsePipe < Coolio::IO
   def initialize(io, client, body)
     super(io)
     @client, @body = client, body