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

Module client

source code

HTTP client module.

Classes [hide private]
  HttpClientRequest
  _PendingRequest
  _NoOpRequestMonitor
No-op request monitor.
  _PendingRequestMonitor
Functions [hide private]
 
_StartRequest(curl, req)
Starts a request on a cURL object.
source code
 
_ProcessCurlRequests(multi, requests)
cURL request processor.
source code
 
ProcessRequests(requests, lock_monitor_cb=None, _curl=pycurl.Curl, _curl_multi=pycurl.CurlMulti, _curl_process=_ProcessCurlRequests)
Processes any number of HTTP client requests.
source code

Imports: logging, pycurl, threading, StringIO, http, compat, netutils, locking


Function Details [hide private]

_StartRequest(curl, req)

source code 

Starts a request on a cURL object.

Parameters:

_ProcessCurlRequests(multi, requests)

source code 

cURL request processor.

This generator yields a tuple once for every completed request, successful or not. The first value in the tuple is the handle, the second an error message or None for successful requests.

Parameters:
  • multi (pycurl.CurlMulti) - cURL multi object
  • requests (sequence) - cURL request handles

ProcessRequests(requests, lock_monitor_cb=None, _curl=pycurl.Curl, _curl_multi=pycurl.CurlMulti, _curl_process=_ProcessCurlRequests)

source code 

Processes any number of HTTP client requests.

Parameters:
  • requests (list of HttpClientRequest) - List of all requests
  • lock_monitor_cb - Callable for registering with lock monitor