Class: Seahorse::Client::AsyncBase
- Defined in:
- lib/seahorse/client/async_base.rb
Instance Attribute Summary collapse
- #connection ⇒ H2::Connection readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#close_connection ⇒ Symbol
Closes the underlying HTTP2 Connection for the client.
- #connection_errors ⇒ Object
-
#initialize(plugins, options) ⇒ AsyncBase
constructor
A new instance of AsyncBase.
-
#new_connection ⇒ Seahorse::Client::H2::Connection
Creates a new HTTP2 Connection for the client.
-
#operation_names ⇒ Array<Symbol>
Returns a list of valid async request operation names.
Methods inherited from Base
add_plugin, api, #build_request, clear_plugins, define, #inspect, new, plugins, remove_plugin, set_api, set_plugins
Methods included from HandlerBuilder
#handle, #handle_request, #handle_response, #handler_for, #new_handler
Constructor Details
#initialize(plugins, options) ⇒ AsyncBase
Returns a new instance of AsyncBase.
14 15 16 17 |
# File 'lib/seahorse/client/async_base.rb', line 14 def initialize(plugins, ) super(plugins, ) @connection = H2::Connection.new(@config) end |
Instance Attribute Details
#connection ⇒ H2::Connection (readonly)
20 21 22 |
# File 'lib/seahorse/client/async_base.rb', line 20 def connection @connection end |
Instance Method Details
#close_connection ⇒ Symbol
Closes the underlying HTTP2 Connection for the client
30 31 32 |
# File 'lib/seahorse/client/async_base.rb', line 30 def close_connection @connection.close! end |
#connection_errors ⇒ Object
44 45 46 |
# File 'lib/seahorse/client/async_base.rb', line 44 def connection_errors @connection.errors end |
#new_connection ⇒ Seahorse::Client::H2::Connection
Creates a new HTTP2 Connection for the client
36 37 38 39 40 41 42 |
# File 'lib/seahorse/client/async_base.rb', line 36 def new_connection if @connection.closed? @connection = H2::Connection.new(@config) else @connection end end |
#operation_names ⇒ Array<Symbol>
Returns a list of valid async request operation names.
24 25 26 |
# File 'lib/seahorse/client/async_base.rb', line 24 def operation_names self.class.api.async_operation_names end |