class Artemis::Adapters::NetHttpPersistentAdapter

Attributes

_connection[R]
raw_connection[R]

Public Class Methods

new(uri, service_name: , timeout: , pool_size: , adapter_options: {}) click to toggle source
Calls superclass method Artemis::Adapters::AbstractAdapter::new
# File lib/artemis/adapters/net_http_persistent_adapter.rb, line 15
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

Public Instance Methods

connection() click to toggle source

Public: Extension point for subclasses to customize the Net:HTTP client

Returns a Net::HTTP object

# File lib/artemis/adapters/net_http_persistent_adapter.rb, line 29
def connection
  _connection
end