Class: AmplitudeExperiment::PersistentHttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/experiment/persistent_http_client.rb

Overview

Persist Http Client to reuse connection and reduce IO

Defined Under Namespace

Classes: ConnectionManager

Constant Summary collapse

DEFAULT_OPTIONS =
{ read_timeout: 80 }.freeze

Class Method Summary collapse

Class Method Details

.get(url, options = {}) ⇒ Object

url: URI / String options: any options that Net::HTTP.new accepts



9
10
11
12
# File 'lib/experiment/persistent_http_client.rb', line 9

def get(url, options = {})
  uri = url.is_a?(URI) ? url : URI(url)
  connection_manager.get_client(uri, options)
end