| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.Redis.Cluster
Synopsis
- data Connection = Connection {
- connectionNodes :: HashMap NodeID NodeConnection
- connectionPipeline :: MVar Pipeline
- connectionShardMap :: MVar ShardMap
- connectionInfoMap :: InfoMap
- connectionHooks :: Hooks
- data NodeRole
- data NodeConnection = NodeConnection {}
- data Node = Node {}
- newtype ShardMap = ShardMap (IntMap Shard)
- data HashSlot
- data Shard = Shard {
- shardMaster :: MasterNode
- shardSlaves :: [SlaveNode]
- connect :: [CommandInfo] -> MVar ShardMap -> Maybe Int -> Hooks -> IO Connection
- connectWith :: Maybe ByteString -> Maybe ByteString -> Maybe ClientParams -> [CommandInfo] -> MVar ShardMap -> Maybe Int -> Hooks -> IO Connection
- disconnect :: Connection -> IO ()
- requestPipelined :: IO ShardMap -> Connection -> [ByteString] -> IO Reply
- nodes :: ShardMap -> [Node]
- hooks :: Connection -> Hooks
- requestMasterNodes :: Connection -> [ByteString] -> IO [Reply]
- masterNodes :: Connection -> IO [NodeConnection]
- getRandomConnection :: NodeConnection -> Connection -> NodeConnection
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
Constructors
| Connection | |
Fields
| |
data NodeConnection Source #
A connection to a single node in the cluster, similar to Connection
Constructors
| NodeConnection | |
Fields | |
Instances
| Eq NodeConnection Source # | |
Defined in Database.Redis.Cluster Methods (==) :: NodeConnection -> NodeConnection -> Bool # (/=) :: NodeConnection -> NodeConnection -> Bool # | |
| Ord NodeConnection Source # | |
Defined in Database.Redis.Cluster Methods compare :: NodeConnection -> NodeConnection -> Ordering # (<) :: NodeConnection -> NodeConnection -> Bool # (<=) :: NodeConnection -> NodeConnection -> Bool # (>) :: NodeConnection -> NodeConnection -> Bool # (>=) :: NodeConnection -> NodeConnection -> Bool # max :: NodeConnection -> NodeConnection -> NodeConnection # min :: NodeConnection -> NodeConnection -> NodeConnection # | |
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
A map from hashslot to shards
Instances
| Enum HashSlot Source # | |
Defined in Database.Redis.Cluster.HashSlot | |
| Num HashSlot Source # | |
Defined in Database.Redis.Cluster.HashSlot | |
| Integral HashSlot Source # | |
Defined in Database.Redis.Cluster.HashSlot | |
| Real HashSlot Source # | |
Defined in Database.Redis.Cluster.HashSlot Methods toRational :: HashSlot -> Rational # | |
| Show HashSlot Source # | |
| Eq HashSlot Source # | |
| Ord HashSlot Source # | |
Defined in Database.Redis.Cluster.HashSlot | |
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
| |
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.
connectWith :: Maybe ByteString -> Maybe ByteString -> Maybe ClientParams -> [CommandInfo] -> MVar ShardMap -> Maybe Int -> Hooks -> IO Connection Source #
Connects to cluster.
disconnect :: Connection -> IO () Source #
requestPipelined :: IO ShardMap -> Connection -> [ByteString] -> IO Reply Source #
hooks :: Connection -> Hooks Source #
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.