memcache-0.2.0.0: A memcached client library.

Copyright(c) David Terei, 2016
LicenseBSD
Maintainercode@davidterei.com
Stabilitystable
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Database.Memcache.Server

Contents

Description

Handles the connections between a Memcached client and a single server.

Memcached expected errors (part of protocol) are returned in the Response, unexpected errors (e.g., network failure) are thrown as exceptions. While the Server datatype supports a failed and failedAt flag for managing retries, it's up to consumers to use this.

Synopsis

Server

data Server Source

Memcached server connection.

newServer :: HostName -> PortNumber -> Authentication -> IO Server Source

Create a new Memcached server connection.

sendRecv :: Server -> Request -> IO Response Source

Send and receive a single request/response pair to the Memcached server.

withSocket :: Server -> (Socket -> IO a) -> IO a Source

Run a function with access to an server socket for using send and recv.

close :: Server -> IO () Source

Close the server connection. If you perform another operation after this, the connection will be re-established.