Package ganeti :: Package http :: Module client :: Class HttpClientPool
[hide private]
[frames] | no frames]

Class HttpClientPool

source code

A simple HTTP client pool.

Supports one pooled connection per identity (see HttpClientRequest.identity).

Instance Methods [hide private]
 
__init__(self, curl_config_fn)
Initializes this class.
source code
 
_Get(self, identity)
Gets an HTTP client from the pool.
source code
 
_StartRequest(self, req)
Starts a request.
source code
 
_Return(self, pclients)
Returns HTTP clients to the pool.
source code
 
ProcessRequests(self, requests)
Processes any number of HTTP client requests using pooled objects.
source code
Static Methods [hide private]
 
_GetHttpClientCreator()
Returns callable to create HTTP client.
source code
 
_CreateCurlMultiHandle()
Creates new cURL multi handle.
source code
Class Variables [hide private]
  _MAX_GENERATIONS_DROP = 25
After how many generations to drop unused clients
Method Details [hide private]

__init__(self, curl_config_fn)
(Constructor)

source code 

Initializes this class.

Parameters:
  • curl_config_fn (callable) - Function to configure cURL object after initialization

_Get(self, identity)

source code 

Gets an HTTP client from the pool.

Parameters:
  • identity (string) - Client identifier

_StartRequest(self, req)

source code 

Starts a request.

Parameters:

ProcessRequests(self, requests)

source code 

Processes any number of HTTP client requests using pooled objects.

Parameters: