riak-0.7.0.1: A Haskell client for the Riak decentralized data store

Portabilityportable
Stabilityexperimental
MaintainerBryan O'Sullivan <bos@serpentine.com>
Safe HaskellSafe-Infered

Network.Riak.Connection

Contents

Description

Low-level network connection management.

Synopsis

Connection management

connect :: Client -> IO ConnectionSource

Connect to a server.

disconnect :: Connection -> IO ()Source

Disconnect from a server.

Client configuration

defaultClient :: ClientSource

Default client configuration. Talks to localhost, port 8087, with a randomly chosen client ID.

makeClientID :: IO ClientIDSource

Generate a random client ID.

Requests and responses

Sending and receiving

exchange :: Exchange req resp => Connection -> req -> IO respSource

Send a request to the server, and receive its response.

exchangeMaybe :: Exchange req resp => Connection -> req -> IO (Maybe resp)Source

Send a request to the server, and receive its response (which may be empty).

exchange_ :: Request req => Connection -> req -> IO ()Source

Send a request to the server, and receive its response, but do not decode it.

Pipelining many requests

pipeline :: Exchange req resp => Connection -> [req] -> IO [resp]Source

Send a series of requests to the server, back to back, and receive a response for each request sent. The sending and receiving will be overlapped if possible, to improve concurrency and reduce latency.

pipelineMaybe :: Exchange req resp => Connection -> [req] -> IO [Maybe resp]Source

Send a series of requests to the server, back to back, and receive a response for each request sent (the responses may be empty). The sending and receiving will be overlapped if possible, to improve concurrency and reduce latency.

pipeline_ :: Request req => Connection -> [req] -> IO ()Source

Send a series of requests to the server, back to back, and receive (but do not decode) a response for each request sent. The sending and receiving will be overlapped if possible, to improve concurrency and reduce latency.