Class: Seahorse::Client::NetHttp::ConnectionPool::ExtendedSession Private

Inherits:
Delegator
  • Object
show all
Defined in:
lib/seahorse/client/net_http/connection_pool.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Helper methods extended onto Net::HTTPSession objects opened by the connection pool.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ ExtendedSession

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ExtendedSession.



330
331
332
333
# File 'lib/seahorse/client/net_http/connection_pool.rb', line 330

def initialize(http)
  super(http)
  @http = http
end

Instance Attribute Details

#last_usedInteger? (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Integer, nil)


336
337
338
# File 'lib/seahorse/client/net_http/connection_pool.rb', line 336

def last_used
  @last_used
end

Instance Method Details

#__getobj__Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



338
339
340
# File 'lib/seahorse/client/net_http/connection_pool.rb', line 338

def __getobj__
  @http
end

#__setobj__(obj) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



342
343
344
# File 'lib/seahorse/client/net_http/connection_pool.rb', line 342

def __setobj__(obj)
  @http = obj
end

#finishObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Attempts to close/finish the session without raising an error.



353
354
355
356
357
# File 'lib/seahorse/client/net_http/connection_pool.rb', line 353

def finish
  @http.finish
rescue IOError
  nil
end

#request(*args, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sends the request and tracks that this session has been used.



347
348
349
350
# File 'lib/seahorse/client/net_http/connection_pool.rb', line 347

def request(*args, &block)
  @http.request(*args, &block)
  @last_used = Aws::Util.monotonic_milliseconds
end