class Async::HTTP::Protocol::HTTP2::Output

def passthrough(task)

Reads chunks from the given body and writes them to the stream as fast as possible.
def passthrough(task)
	task.annotate("Writing #{@body} to #{@stream}.")
	
	while chunk = @body&.read
		self.write(chunk)
		# TODO this reduces memory usage?
		# chunk.clear unless chunk.frozen?
		# GC.start
	end
rescue => error
	raise
ensure
	# Ensure the body we are reading from is fully closed:
	if body = @body
		@body = nil
		body.close(error)
	end
	
	# Ensure the output of this body is closed:
	self.close_write(error)
end