Class: Async::HTTP::Protocol::HTTP2::Stream::Input

Inherits:
Body::Writable
  • Object
show all
Defined in:
lib/async/http/protocol/http2/stream.rb

Instance Method Summary collapse

Methods inherited from Body::Writable

#close, #closed?, #empty?, #inspect, #length, #write

Constructor Details

#initialize(stream, length) ⇒ Input

Returns a new instance of Input.



30
31
32
33
34
# File 'lib/async/http/protocol/http2/stream.rb', line 30

def initialize(stream, length)
	super(length)
	
	@stream = stream
end

Instance Method Details

#readObject



36
37
38
39
40
41
42
43
# File 'lib/async/http/protocol/http2/stream.rb', line 36

def read
	if chunk = super
		# If we read a chunk fron the stream, we want to extend the window if required so more data will be provided.
		@stream.request_window_update
	end
	
	return chunk
end