rev: split out deferred chunk logic from unchunked
[rainbows.git] / lib / rainbows / rev / deferred_chunk_response.rb
blob35991d13d4a0c1f73d53cb62d6d9aa4ba0050445
1 # -*- encoding: binary -*-
2 # :enddoc:
4 # this is class is specific to Rev for proxying IO-derived objects
5 class Rainbows::Rev::DeferredChunkResponse < Rainbows::Rev::DeferredResponse
6   def on_read(data)
7     @client.write("#{data.size.to_s(16)}\r\n")
8     @client.write(data)
9     @client.write("\r\n")
10   end
12   def on_close
13     @client.write("0\r\n\r\n")
14     super
15   end
16 end