hedis
Safe HaskellNone
LanguageHaskell2010

Database.Redis.Cluster

Synopsis

Documentation

data Connection Source #

A connection to a redis cluster, it is composed of a map from Node IDs to | NodeConnections, a Pipeline, and a ShardMap

data NodeRole Source #

Constructors

Master 
Slave 

Instances

Instances details
Show NodeRole Source # 
Instance details

Defined in Database.Redis.Cluster

Eq NodeRole Source # 
Instance details

Defined in Database.Redis.Cluster

Ord NodeRole Source # 
Instance details

Defined in Database.Redis.Cluster

data Node Source #

Represents a single node, note that this type does not include the connection to the node because the shard map can be shared amongst multiple connections

Constructors

Node 

Fields

Instances

Instances details
Show Node Source # 
Instance details

Defined in Database.Redis.Cluster

Methods

showsPrec :: Int -> Node -> ShowS #

show :: Node -> String #

showList :: [Node] -> ShowS #

Eq Node Source # 
Instance details

Defined in Database.Redis.Cluster

Methods

(==) :: Node -> Node -> Bool #

(/=) :: Node -> Node -> Bool #

Ord Node Source # 
Instance details

Defined in Database.Redis.Cluster

Methods

compare :: Node -> Node -> Ordering #

(<) :: Node -> Node -> Bool #

(<=) :: Node -> Node -> Bool #

(>) :: Node -> Node -> Bool #

(>=) :: Node -> Node -> Bool #

max :: Node -> Node -> Node #

min :: Node -> Node -> Node #

newtype ShardMap Source #

A map from hashslot to shards

Constructors

ShardMap (IntMap Shard) 

Instances

Instances details
Show ShardMap Source # 
Instance details

Defined in Database.Redis.Cluster

data HashSlot Source #

Instances

Instances details
Enum HashSlot Source # 
Instance details

Defined in Database.Redis.Cluster.HashSlot

Num HashSlot Source # 
Instance details

Defined in Database.Redis.Cluster.HashSlot

Integral HashSlot Source # 
Instance details

Defined in Database.Redis.Cluster.HashSlot

Real HashSlot Source # 
Instance details

Defined in Database.Redis.Cluster.HashSlot

Show HashSlot Source # 
Instance details

Defined in Database.Redis.Cluster.HashSlot

Eq HashSlot Source # 
Instance details

Defined in Database.Redis.Cluster.HashSlot

Ord HashSlot Source # 
Instance details

Defined in Database.Redis.Cluster.HashSlot

data Shard Source #

A shard is a master node and 0 or more slaves, (the master, slave terminology is unfortunate but I felt it better to follow the documentation until it changes).

Constructors

Shard 

Fields

Instances

Instances details
Show Shard Source # 
Instance details

Defined in Database.Redis.Cluster

Methods

showsPrec :: Int -> Shard -> ShowS #

show :: Shard -> String #

showList :: [Shard] -> ShowS #

Eq Shard Source # 
Instance details

Defined in Database.Redis.Cluster

Methods

(==) :: Shard -> Shard -> Bool #

(/=) :: Shard -> Shard -> Bool #

Ord Shard Source # 
Instance details

Defined in Database.Redis.Cluster

Methods

compare :: Shard -> Shard -> Ordering #

(<) :: Shard -> Shard -> Bool #

(<=) :: Shard -> Shard -> Bool #

(>) :: Shard -> Shard -> Bool #

(>=) :: Shard -> Shard -> Bool #

max :: Shard -> Shard -> Shard #

min :: Shard -> Shard -> Shard #

connect :: [CommandInfo] -> MVar ShardMap -> Maybe Int -> Hooks -> IO Connection Source #

Deprecated: Use connectWith instead, passing Nothing for the parameters you don't need.

Backwards compatible version of connect that can't provide authentication or TLS parameters.

requestMasterNodes :: Connection -> [ByteString] -> IO [Reply] Source #

Send a request to all master nodes in the cluster. This is useful for commands that need to be sent to all master nodes, such as FLUSHALL or `CONFIG SET`.

masterNodes :: Connection -> IO [NodeConnection] Source #

Get connection to a master nodes in the cluster. This is useful for commands that need to be sent to all master nodes, such as FLUSHALL or `CONFIG SET`.

getRandomConnection :: NodeConnection -> Connection -> NodeConnection Source #

Get connection to a random node in the cluster that is not the same as the provided connection.