riakcached.pools

class riakcached.pools.Pool(base_url='http://127.0.0.1:8098', timeout=2, auto_connect=True)[source]

A Riak HTTP request connection pool base class

This is the base class that should be used for any custom connection pool to be used by any of the riakcached.clients.RiakClient

Constructs a new riakcached.pools.Pool

Parameters:
  • base_url (str) – the base url that the client should use for requests
  • timeout (int) – the connection timeout to use
  • auto_connect (bool) – whether or not to call connect() on __init__
close()[source]

Closes the connection pool if it is opened

connect()[source]

Create the connection pool

request(method, url, body=None, headers=None)[source]

Makes a single HTTP request

Parameters:
  • method (str) – the HTTP method to make the requets with
  • url (str) – the full url for the request
  • body (str) – the data to POST or PUT with the request
  • headers (dict) – extra headers to add to the request
Returns:

tuple - status, data, headers

Raises :

riakcached.exceptions.RiakcachedTimeout

Raises :

riakcached.exceptions.RiakcachedConnectionError

class riakcached.pools.Urllib3Pool(base_url='http://127.0.0.1:8098', timeout=2, auto_connect=True)[source]

A subclass of riakcached.pools.Pool which uses urllib3 for requests

Constructs a new riakcached.pools.Pool

Parameters:
  • base_url (str) – the base url that the client should use for requests
  • timeout (int) – the connection timeout to use
  • auto_connect (bool) – whether or not to call connect() on __init__
close()[source]

Closes the connection pool if it is opened

connect()[source]

Create the connection pool

request(method, url, body=None, headers=None)[source]

Makes a single HTTP request

Parameters:
  • method (str) – the HTTP method to make the requets with
  • url (str) – the full url for the request
  • body (str) – the data to POST or PUT with the request
  • headers (dict) – extra headers to add to the request
Returns:

tuple - status, data, headers

Raises :

riakcached.exceptions.RiakcachedTimeout

Raises :

riakcached.exceptions.RiakcachedConnectionError

Table Of Contents

Previous topic

riakcached.exceptions

This Page