about summary refs log tree commit homepage
path: root/lib/rainbows/coolio
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 /lib/rainbows/coolio
parented28feabd79697cb27722036622aeca1fbf0723d (diff)
downloadrainbows-4a76da1833922c74e147be5def9bfe04fd0c16a2.tar.gz
coolio: rename deferred_response => response_pipe
For consistency with the EventMachine code
Diffstat (limited to 'lib/rainbows/coolio')
-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
3 files changed, 8 insertions, 9 deletions
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