Restful json clients.
Use Resource for a single host. Use Resources for multiple hosts with simple partitioning or redundancy. Use Shards for horizontally partitioning hosts by different keys.
Resources optionally reuse connections, handling request timeouts. Broadcasting to multiple resources is parallelized with asynchronous requests and responses.
The load balancing strategy is randomized, biased by the number of cached connections available. This inherently provides limited failover support, but applications must still handle exceptions as desired.
Bases: httplib.HTTPResponse
A completed response which handles json and caches its body.
HTTP status code
HTTP status message
string of entire response body
server response time
Return whether status is successful.
Return evaluated response body or raise exception.
Bases: httplib.HTTPConnection
Synchronous connection which handles json responses.
Get the response from the server.
Pipeline requests (method, path[, body]) and return completed responses.
Send request after handling body and headers.
Thread-safe mapping of hosts to optionally persistent resources.
Parameters: |
|
---|
Queue of prioritized resources.
Send requests and return responses from all hosts, optionally from given subset.
Return chosen host according to priority.
Return priority for host. None may be used to eliminate from consideration.
Mapping of keys to host clusters, with associated resources.
Parameters: |
|
---|
Send requests and return responses from all hosts for corresponding key.
Return chosen host according to priority.
Send requests and return responses from a minimal subset of hosts which cover all corresponding keys. Response overlap is possible depending on partitioning.
Return combined priority for hosts.