persistent-redis-0.3.1: Backend for persistent library using Redis.

Safe HaskellNone
LanguageHaskell98

Database.Persist.Redis

Synopsis

Documentation

data RedisConf Source

Information required to connect to a Redis server

Constructors

RedisConf 

Fields

rdHost :: Text

Host

rdPort :: PortID

Port

rdAuth :: Maybe RedisAuth

Auth info

rdMaxConn :: Int

Maximum number of connections

class MonadRedis m => RedisCtx m f | m -> f

This class captures the following behaviour: In a context m, a command will return it's result wrapped in a "container" of type f.

Please refer to the Command Type Signatures section of this page for more information.

Minimal complete definition

returnDecode

data Redis a :: * -> *

Context for normal command execution, outside of transactions. Use runRedis to run actions of this type.

In this context, each result is wrapped in an Either to account for the possibility of Redis returning an Error reply.

type RedisT = ReaderT Connection Source

Monad reader transformer keeping Redis connection through out the work

withRedisConn :: (Monad m, MonadIO m) => RedisConf -> (Connection -> m a) -> m a Source

Run a connection reader function against a Redis configuration

thisConnection :: Monad m => RedisT m Connection Source

Extracts connection from RedisT monad transformer

execRedisT :: (Monad m, MonadIO m) => RedisTx (Queued a) -> RedisT m a Source

Execute Redis transaction inside RedisT monad transformer