Class: Artemis::Adapters::NetHttpPersistentAdapter
- Inherits:
-
NetHttpAdapter
- Object
- GraphQL::Client::HTTP
- AbstractAdapter
- NetHttpAdapter
- Artemis::Adapters::NetHttpPersistentAdapter
- Defined in:
- lib/artemis/adapters/net_http_persistent_adapter.rb
Constant Summary
Constants inherited from AbstractAdapter
AbstractAdapter::DEFAULT_HEADERS, AbstractAdapter::EMPTY_HEADERS
Instance Attribute Summary collapse
-
#_connection ⇒ Object
readonly
Returns the value of attribute _connection.
-
#raw_connection ⇒ Object
readonly
Returns the value of attribute raw_connection.
Attributes inherited from AbstractAdapter
#pool_size, #service_name, #timeout
Instance Method Summary collapse
-
#connection ⇒ Object
Public: Extension point for subclasses to customize the Net:HTTP client.
-
#initialize(uri, service_name:, timeout:, pool_size:, adapter_options: {}) ⇒ NetHttpPersistentAdapter
constructor
A new instance of NetHttpPersistentAdapter.
Methods inherited from NetHttpAdapter
Methods inherited from AbstractAdapter
Constructor Details
#initialize(uri, service_name:, timeout:, pool_size:, adapter_options: {}) ⇒ NetHttpPersistentAdapter
Returns a new instance of NetHttpPersistentAdapter.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 27 def initialize(uri, service_name: , timeout: , pool_size: , adapter_options: {}) super @raw_connection = Net::HTTP::Persistent.new(name: service_name, pool_size: pool_size) @raw_connection.open_timeout = timeout @raw_connection.read_timeout = timeout @raw_connection.idle_timeout = 30.minutes.to_i # TODO: Make it configurable @_connection = ConnectionWrapper.new(@raw_connection, uri) end |
Instance Attribute Details
#_connection ⇒ Object (readonly)
Returns the value of attribute _connection.
25 26 27 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 25 def _connection @_connection end |
#raw_connection ⇒ Object (readonly)
Returns the value of attribute raw_connection.
25 26 27 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 25 def raw_connection @raw_connection end |
Instance Method Details
#connection ⇒ Object
Public: Extension point for subclasses to customize the Net:HTTP client
Returns a Net::HTTP object
41 42 43 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 41 def connection _connection end |