hedis
Safe HaskellNone
LanguageHaskell2010

Database.Redis.ProtocolPipelining

Description

A module for automatic, optimal protocol pipelining.

Protocol pipelining is a technique in which multiple requests are written out to a single socket without waiting for the corresponding responses. The pipelining of requests results in a dramatic improvement in protocol performance.

Optimal Pipelining
uses the least number of network packets possible
Automatic Pipelining
means that requests are implicitly pipelined as much as possible, i.e. as long as a request's response is not used before any subsequent requests.
Synopsis

Documentation

request :: Connection -> ByteString -> IO Reply Source #

Send a request and receive the corresponding reply

send :: Connection -> ByteString -> IO () Source #

Write the request to the socket output buffer, without actually sending. The Handle is hFlushed when reading replies from the connCtx.

recv :: Connection -> IO Reply Source #

Take a reply-thunk from the list of future replies.

flush :: Connection -> IO () Source #

Flush the socket. Normally, the socket is flushed in recv (actually conGetReplies), but for the multithreaded pub/sub code, the sending thread needs to explicitly flush the subscription change requests.