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.



135
136
137
138
# File 'lib/3scale/client/http_client.rb', line 135

def initialize(*)
  super
  @http.start
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


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

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

Instance Method Details

#get_requestObject



145
146
147
# File 'lib/3scale/client/http_client.rb', line 145

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

#post_requestObject



149
150
151
# File 'lib/3scale/client/http_client.rb', line 149

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

#ssl!Object



140
141
142
143
# File 'lib/3scale/client/http_client.rb', line 140

def ssl!
  super
  @http.start
end