Sha256: c257542259e5537910dc99e4eb8ab10fa4040cadd5a11ffbd7e5934d82d3280b

Contents?: true

Size: 617 Bytes

Versions: 21

Compression:

Stored size: 617 Bytes

Contents

# -*- encoding: binary -*-
# :enddoc:
#
class Rainbows::Epoll::ResponsePipe
  attr_reader :io
  alias to_io io
  RBUF = Rainbows::EvCore::RBUF
  EP = Rainbows::EP

  def initialize(io, client, body)
    @io, @client, @body = io, client, body
  end

  def epoll_run
    return close if @client.closed?
    @client.stream_pipe(self) or @client.on_deferred_write_complete
    rescue => e
      close
      @client.handle_error(e)
  end

  def close
    @io or return
    EP.delete self
    @body.respond_to?(:close) and @body.close
    @io = @body = nil
  end

  def tryread
    Kgio.tryread(@io, 16384, RBUF)
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rainbows-5.1.1 lib/rainbows/epoll/response_pipe.rb
rainbows-5.1.0 lib/rainbows/epoll/response_pipe.rb
rainbows-5.0.0.5.ge717 lib/rainbows/epoll/response_pipe.rb
rainbows-5.0.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.7.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.6.2 lib/rainbows/epoll/response_pipe.rb
rainbows-4.6.1 lib/rainbows/epoll/response_pipe.rb
rainbows-4.6.0.4.g4108 lib/rainbows/epoll/response_pipe.rb
rainbows-4.6.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.5.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.4.3 lib/rainbows/epoll/response_pipe.rb
rainbows-4.4.2 lib/rainbows/epoll/response_pipe.rb
rainbows-4.4.1.1.gd5c8c lib/rainbows/epoll/response_pipe.rb
rainbows-4.4.1 lib/rainbows/epoll/response_pipe.rb
rainbows-4.4.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.3.1 lib/rainbows/epoll/response_pipe.rb
rainbows-4.3.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.2.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.1.0 lib/rainbows/epoll/response_pipe.rb
rainbows-4.0.0 lib/rainbows/epoll/response_pipe.rb