Sha256: 5e671202e8ccd976fbdf488840154b04a1d3e3193d9618a050ecda637c916360
Contents?: true
Size: 568 Bytes
Versions: 70
Compression:
Stored size: 568 Bytes
Contents
module Files class SizableIO < IO def self.pipe r, w = super w.instance_variable_set(:@read_io, r) [ r, w ] end def size read_io.content_length_promise.wait.value end def fulfill_content_length(length) read_io.content_length = length read_io.content_length_promise.execute end protected attr_accessor :content_length def content_length_promise @content_length_promise ||= Concurrent::Promise.new { content_length } end def read_io @read_io || self end end end
Version data entries
70 entries across 70 versions & 1 rubygems