1 # -*- encoding: binary -*-
4 # this is class is specific to Rev for writing large static files
5 # or proxying IO-derived objects
6 class Rainbows::Rev::DeferredResponse < ::Rev::IO
7 def initialize(io, client, do_chunk, body)
9 @client, @do_chunk, @body = client, do_chunk, body
13 @do_chunk and @client.write("#{data.size.to_s(16)}\r\n")
15 @do_chunk and @client.write("\r\n")
19 @do_chunk and @client.write("0\r\n\r\n")
21 @body.respond_to?(:close) and @body.close