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:) ⇒ NetHttpPersistentAdapter
constructor
A new instance of NetHttpPersistentAdapter.
Methods inherited from NetHttpAdapter
Methods inherited from AbstractAdapter
Constructor Details
#initialize(uri, service_name:, timeout:, pool_size:) ⇒ NetHttpPersistentAdapter
Returns a new instance of NetHttpPersistentAdapter.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 15 def initialize(uri, service_name: , timeout: , pool_size: ) 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.
13 14 15 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 13 def _connection @_connection end |
#raw_connection ⇒ Object (readonly)
Returns the value of attribute raw_connection.
13 14 15 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 13 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
29 30 31 |
# File 'lib/artemis/adapters/net_http_persistent_adapter.rb', line 29 def connection _connection end |