Method: HTTPX::Connection::HTTP2#initialize

Defined in:
lib/httpx/connection/http2.rb

#initialize(buffer, options) ⇒ HTTP2

Returns a new instance of HTTP2.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/httpx/connection/http2.rb', line 35

def initialize(buffer, options)
  @options = options
  @settings = @options.http2_settings
  @pending = []
  @streams = {}
  @drains = {}
  @pings = []
  @buffer = buffer
  @handshake_completed = false
  @wait_for_handshake = @settings.key?(:wait_for_handshake) ? @settings.delete(:wait_for_handshake) : true
  @max_concurrent_requests = @options.max_concurrent_requests || MAX_CONCURRENT_REQUESTS
  @max_requests = @options.max_requests
  init_connection
end