Sha256: 861304dcf802df42a8d723dcce0a916ef413a9ab91018e79d640047f66ff74ae

Contents?: true

Size: 524 Bytes

Versions: 9

Compression:

Stored size: 524 Bytes

Contents

# -*- encoding: binary -*-
# :enddoc:

# Used to keep track of file offsets in IO#sendfile_nonblock + evented
# models.  We always maintain our own file offsets in userspace because
# because sendfile() implementations offer pread()-like idempotency for
# concurrency (multiple clients can read the same underlying file handle).
class Rainbows::StreamFile < Struct.new(:offset, :count, :to_io, :body)
  def close
    body.close if body.respond_to?(:close)
    to_io.close unless to_io.closed?
    self.to_io = nil
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rainbows-3.1.0 lib/rainbows/stream_file.rb
rainbows-3.0.0 lib/rainbows/stream_file.rb
rainbows-2.1.0 lib/rainbows/stream_file.rb
rainbows-2.0.1 lib/rainbows/stream_file.rb
rainbows-2.0.0 lib/rainbows/stream_file.rb
rainbows-1.0.0 lib/rainbows/stream_file.rb
rainbows-1.0.0pre1 lib/rainbows/stream_file.rb
rainbows-0.97.0 lib/rainbows/stream_file.rb
rainbows-0.96.0 lib/rainbows/stream_file.rb