Method: HTTPX::Channel#initialize

Defined in:
lib/httpx/channel.rb

#initialize(type, uri, options) ⇒ Channel

Returns a new instance of Channel.



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/httpx/channel.rb', line 70

def initialize(type, uri, options)
  @type = type
  @uri = uri
  @origins = [@uri.origin]
  @options = Options.new(options)
  @window_size = @options.window_size
  @read_buffer = Buffer.new(BUFFER_SIZE)
  @write_buffer = Buffer.new(BUFFER_SIZE)
  @pending = []
  on(:error) { |ex| on_error(ex) }
  transition(:idle)
end