diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-12-30 08:32:28 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-04 16:21:17 -0800 |
commit | 4a76da1833922c74e147be5def9bfe04fd0c16a2 (patch) | |
tree | 7ee061ee23e7bff38110341a81ed7a315a0e373c /lib/rainbows/coolio/response_chunk_pipe.rb | |
parent | ed28feabd79697cb27722036622aeca1fbf0723d (diff) | |
download | rainbows-4a76da1833922c74e147be5def9bfe04fd0c16a2.tar.gz |
coolio: rename deferred_response => response_pipe
For consistency with the EventMachine code
Diffstat (limited to 'lib/rainbows/coolio/response_chunk_pipe.rb')
-rw-r--r-- | lib/rainbows/coolio/response_chunk_pipe.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rainbows/coolio/response_chunk_pipe.rb b/lib/rainbows/coolio/response_chunk_pipe.rb new file mode 100644 index 0000000..5e456e9 --- /dev/null +++ b/lib/rainbows/coolio/response_chunk_pipe.rb @@ -0,0 +1,16 @@ +# -*- encoding: binary -*- +# :enddoc: +# +# this is class is specific to Coolio for proxying IO-derived objects +class Rainbows::Coolio::ResponseChunkPipe < Rainbows::Coolio::ResponsePipe + def on_read(data) + @client.write("#{data.size.to_s(16)}\r\n") + @client.write(data) + @client.write("\r\n") + end + + def on_close + @client.write("0\r\n\r\n") + super + end +end |