| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- data Connection
- connect :: ConnectAddr -> Maybe Int -> Maybe ClientParams -> IO Connection
- connectWithHooks :: ConnectAddr -> Maybe Int -> Maybe ClientParams -> Hooks -> IO Connection
- beginReceiving :: Connection -> IO ()
- disconnect :: Connection -> IO ()
- request :: Connection -> ByteString -> IO Reply
- send :: Connection -> ByteString -> IO ()
- recv :: Connection -> IO Reply
- flush :: Connection -> IO ()
- fromCtx :: ConnectionContext -> IO Connection
- fromCtxWithHooks :: ConnectionContext -> Hooks -> IO Connection
- hooks :: Connection -> Hooks
Documentation
data Connection Source #
connect :: ConnectAddr -> Maybe Int -> Maybe ClientParams -> IO Connection Source #
connectWithHooks :: ConnectAddr -> Maybe Int -> Maybe ClientParams -> Hooks -> IO Connection Source #
beginReceiving :: Connection -> IO () Source #
disconnect :: Connection -> IO () Source #
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.
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.
fromCtx :: ConnectionContext -> IO Connection Source #
fromCtxWithHooks :: ConnectionContext -> Hooks -> IO Connection Source #
hooks :: Connection -> Hooks Source #