Class: Async::HTTP::Protocol::HTTP2::Client
- Inherits:
-
Protocol::HTTP2::Client
- Object
- Protocol::HTTP2::Client
- Async::HTTP::Protocol::HTTP2::Client
- Includes:
- Connection
- Defined in:
- lib/async/http/protocol/http2/client.rb
Instance Attribute Summary
Attributes included from Connection
Instance Method Summary collapse
-
#call(request) ⇒ Object
Used by the client to send requests to the remote server.
- #create_response ⇒ Object
-
#initialize(stream) ⇒ Client
constructor
A new instance of Client.
Methods included from Connection
#as_json, #close, #concurrency, #http1?, #http2?, #peer, #read_in_background, #reusable?, #start_connection, #synchronize, #to_json, #to_s, #version, #viable?
Constructor Details
#initialize(stream) ⇒ Client
Returns a new instance of Client.
18 19 20 21 22 23 24 |
# File 'lib/async/http/protocol/http2/client.rb', line 18 def initialize(stream) @stream = stream framer = ::Protocol::HTTP2::Framer.new(@stream) super(framer) end |
Instance Method Details
#call(request) ⇒ Object
Used by the client to send requests to the remote server.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/async/http/protocol/http2/client.rb', line 31 def call(request) raise ::Protocol::HTTP2::Error, "Connection closed!" if self.closed? @count += 1 response = create_response response.send_request(request) response.wait return response end |