Class: ThreeScale::Client::HTTPClient::NetHttpKeepAlive

Inherits:
NetHttp show all
Defined in:
lib/3scale/client/http_client.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NetHttp

#get, #post

Methods inherited from BaseClient

prepare

Constructor Details

#initializeNetHttpKeepAlive

Returns a new instance of NetHttpKeepAlive.



133
134
135
136
# File 'lib/3scale/client/http_client.rb', line 133

def initialize(*)
  super
  @http.start
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


127
128
129
130
131
# File 'lib/3scale/client/http_client.rb', line 127

def self.available?
  Net::HTTP.instance_method(:keep_alive_timeout)
rescue NameError
  false
end

Instance Method Details

#get_requestObject



143
144
145
# File 'lib/3scale/client/http_client.rb', line 143

def get_request(*)
  super.tap(&MARK_KEEPALIVE)
end

#post_requestObject



147
148
149
# File 'lib/3scale/client/http_client.rb', line 147

def post_request(*)
  super.tap(&MARK_KEEPALIVE)
end

#ssl!Object



138
139
140
141
# File 'lib/3scale/client/http_client.rb', line 138

def ssl!
  super
  @http.start
end