httpx/test/support/session_with_single_stream.rb
HoneyryderChuck 7aea7fe471 removing a few method_missing implementations
replacing them with SimpleDelegator where it made sense, and removing
them altogether whenever possible. ErrorResponse doesn't have a special
handling for Response methods anymore, but it's highly debatable if it
should.
2021-07-21 15:31:49 +01:00

20 lines
493 B
Ruby

# frozen_string_literal: true
#
# This module is used only to test transitions from a full HTTP/2 connection when it
# exhausts the number of streamss
#
module SessionWithSingleStream
module ConnectionMethods
def build_parser
parser = super
def parser.exhausted?
@connection.active_stream_count.positive?
end
parser.instance_variable_set(:@max_requests, 10)
parser.instance_variable_get(:@connection).max_streams = 1
parser
end
end
end