class Protocol::HTTP2::Dependency

def consume_window(size)

Parameters:
  • amount (Integer) -- the amount of data to write. Defaults to the current window capacity.
def consume_window(size)
	# If there is an associated stream, give it priority:
	if stream = self.stream
		return if stream.window_updated(size)
	end
	
	# Otherwise, allow the dependent children to use up the available window:
	self.ordered_children&.each do |child|
		# Compute the proportional allocation:
		allocated = (child.weight * size) / @total_weight
		
		child.consume_window(allocated) if allocated > 0
	end
end