1 # -*- encoding: binary -*-
3 module Rainbows::EventMachine::ResponsePipe
4 # garbage avoidance, EM always uses this in a single thread,
5 # so a single buffer for all clients will work safely
8 def initialize(client, alive, body)
9 @client, @alive, @body = client, alive, body
14 @client.write(@io.read_nonblock(16384, BUF))
25 @body.close if @body.respond_to?(:close)
27 @io.close unless @io.closed?