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 18 |
# File 'lib/seahorse/client/async_base.rb', line 14 def initialize(plugins, ) super @connection = H2::Connection.new() @options = end |
Instance Attribute Details
#connection ⇒ H2::Connection (readonly)
21 22 23 |
# File 'lib/seahorse/client/async_base.rb', line 21 def connection @connection end |
Instance Method Details
#close_connection ⇒ Symbol
Closes the underlying HTTP2 Connection for the client
31 32 33 |
# File 'lib/seahorse/client/async_base.rb', line 31 def close_connection @connection.close! end |
#connection_errors ⇒ Object
45 46 47 |
# File 'lib/seahorse/client/async_base.rb', line 45 def connection_errors @connection.errors end |
#new_connection ⇒ Seahorse::Client::H2::Connection
Creates a new HTTP2 Connection for the client
37 38 39 40 41 42 43 |
# File 'lib/seahorse/client/async_base.rb', line 37 def new_connection if @connection.closed? @connection = H2::Connection.new(@options) else @connection end end |
#operation_names ⇒ Array<Symbol>
Returns a list of valid async request operation names.
25 26 27 |
# File 'lib/seahorse/client/async_base.rb', line 25 def operation_names self.class.api.async_operation_names end |