epoll_wait: flags argument is unused
[rainbows.git] / lib / rainbows / coolio / response_pipe.rb
blob42483c20b502297c6a83c9ab791756ef93ee7aee
1 # -*- encoding: binary -*-
2 # :enddoc:
4 # this is class is specific to Coolio for writing large static files
5 # or proxying IO-derived objects
6 class Rainbows::Coolio::ResponsePipe < Coolio::IO
7   def initialize(io, client, body)
8     super(io)
9     @client, @body = client, body
10   end
12   def on_read(data)
13     @client.write(data)
14   end
16   def on_close
17     @body.respond_to?(:close) and @body.close
18     @client.next!
19   end
20 end