| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Database.Redis
Description
Convenience re-export module for the hask-redis-mux library.
Import this single module for both standalone and cluster Redis usage.
Standalone usage with bracket pattern (recommended):
{-# LANGUAGE OverloadedStrings #-}
import Database.Redis
main :: IO ()
main = do
result <- runRedis defaultStandaloneConfig $ do
set "mykey" "myvalue"
(val :: ByteString) <- get "mykey"
return val
print result
Typed returns via FromResp:
runRedis defaultStandaloneConfig $ do set "counter" "42" (n :: Integer) <- get "counter" -- automatically parsed (bs :: ByteString) <- get "counter" -- raw bytes (mt :: Maybe Text) <- get "missing" -- Nothing for missing keys
Cluster usage with bracket pattern:
withClusterClient clusterConfig connector $ \client ->
runClusterCommandClient client $ do
set "mykey" "myvalue"
get "mykey"
Since: 0.1.0.0
Synopsis
- class Encodable a where
- data RespData where
- RespSimpleString :: !ByteString -> RespData
- RespError :: !ByteString -> RespData
- RespInteger :: !Integer -> RespData
- RespBulkString :: !ByteString -> RespData
- RespNullBulkString :: RespData
- RespArray :: ![RespData] -> RespData
- RespMap :: !(Map RespData RespData) -> RespData
- RespSet :: !(Set RespData) -> RespData
- parseRespData :: Parser RespData
- parseStrict :: ByteString -> Either String RespData
- class Client (client :: ConnectionStatus -> Type) where
- connect :: MonadIO m => client 'NotConnected -> m (client 'Connected)
- close :: MonadIO m => client 'Connected -> m ()
- send :: MonadIO m => client 'Connected -> ByteString -> m ()
- sendChunks :: MonadIO m => client 'Connected -> [ByteString] -> m ()
- receive :: (MonadIO m, MonadFail m) => client 'Connected -> m ByteString
- data ConnectionStatus
- data PlainTextClient (a :: ConnectionStatus) where
- data TLSClient (a :: ConnectionStatus) where
- NotConnectedTLSClient :: String -> Maybe Int -> TLSClient 'NotConnected
- NotConnectedTLSClientWithHostname :: String -> String -> Maybe Int -> TLSClient 'NotConnected
- TLSTunnel :: TLSClient 'Connected -> TLSClient 'Server
- class MonadIO m => RedisCommands (m :: Type -> Type) where
- auth :: FromResp a => ByteString -> ByteString -> m a
- ping :: FromResp a => m a
- set :: FromResp a => ByteString -> ByteString -> m a
- get :: FromResp a => ByteString -> m a
- mget :: FromResp a => [ByteString] -> m a
- setnx :: FromResp a => ByteString -> ByteString -> m a
- decr :: FromResp a => ByteString -> m a
- psetex :: FromResp a => ByteString -> Int -> ByteString -> m a
- bulkSet :: FromResp a => [(ByteString, ByteString)] -> m a
- flushAll :: FromResp a => m a
- dbsize :: FromResp a => m a
- del :: FromResp a => [ByteString] -> m a
- exists :: FromResp a => [ByteString] -> m a
- incr :: FromResp a => ByteString -> m a
- hset :: FromResp a => ByteString -> ByteString -> ByteString -> m a
- hget :: FromResp a => ByteString -> ByteString -> m a
- hmget :: FromResp a => ByteString -> [ByteString] -> m a
- hexists :: FromResp a => ByteString -> ByteString -> m a
- lpush :: FromResp a => ByteString -> [ByteString] -> m a
- lrange :: FromResp a => ByteString -> Int -> Int -> m a
- expire :: FromResp a => ByteString -> Int -> m a
- ttl :: FromResp a => ByteString -> m a
- rpush :: FromResp a => ByteString -> [ByteString] -> m a
- lpop :: FromResp a => ByteString -> m a
- rpop :: FromResp a => ByteString -> m a
- sadd :: FromResp a => ByteString -> [ByteString] -> m a
- smembers :: FromResp a => ByteString -> m a
- scard :: FromResp a => ByteString -> m a
- sismember :: FromResp a => ByteString -> ByteString -> m a
- hdel :: FromResp a => ByteString -> [ByteString] -> m a
- hkeys :: FromResp a => ByteString -> m a
- hvals :: FromResp a => ByteString -> m a
- llen :: FromResp a => ByteString -> m a
- lindex :: FromResp a => ByteString -> Int -> m a
- clientSetInfo :: FromResp a => [ByteString] -> m a
- clientReply :: ClientReplyValues -> m (Maybe RespData)
- zadd :: FromResp a => ByteString -> [(Int, ByteString)] -> m a
- zrange :: FromResp a => ByteString -> Int -> Int -> Bool -> m a
- geoadd :: FromResp a => ByteString -> [(Double, Double, ByteString)] -> m a
- geodist :: FromResp a => ByteString -> ByteString -> ByteString -> Maybe GeoUnit -> m a
- geohash :: FromResp a => ByteString -> [ByteString] -> m a
- geopos :: FromResp a => ByteString -> [ByteString] -> m a
- georadius :: FromResp a => ByteString -> Double -> Double -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a
- georadiusRo :: FromResp a => ByteString -> Double -> Double -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a
- georadiusByMember :: FromResp a => ByteString -> ByteString -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a
- georadiusByMemberRo :: FromResp a => ByteString -> ByteString -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a
- geosearch :: FromResp a => ByteString -> GeoSearchFrom -> GeoSearchBy -> [GeoSearchOption] -> m a
- geosearchstore :: FromResp a => ByteString -> ByteString -> GeoSearchFrom -> GeoSearchBy -> [GeoSearchOption] -> Bool -> m a
- clusterSlots :: FromResp a => m a
- data ClientState (client :: ConnectionStatus -> Type) = ClientState {
- getClient :: client 'Connected
- getParseBuffer :: ByteString
- data ClientReplyValues
- data RedisCommandClient (client :: ConnectionStatus -> Type) a where
- RedisCommandClient :: forall (client :: ConnectionStatus -> Type) a. Client client => {..} -> RedisCommandClient client a
- data RedisError
- convertResp :: (FromResp a, MonadIO m) => RespData -> m a
- encodeBulkArg :: ByteString -> Builder
- encodeCommand :: [ByteString] -> ByteString
- encodeCommandBuilder :: [ByteString] -> Builder
- encodeGetBuilder :: ByteString -> Builder
- encodeSetBuilder :: ByteString -> ByteString -> Builder
- parseManyWith :: forall (client :: ConnectionStatus -> Type) m. (Client client, MonadIO m, MonadState (ClientState client) m) => Int -> m ByteString -> m [RespData]
- parseWith :: forall (client :: ConnectionStatus -> Type) m. (Client client, MonadIO m, MonadState (ClientState client) m) => m ByteString -> m RespData
- showBS :: Show a => a -> ByteString
- class FromResp a where
- fromResp :: RespData -> Either RedisError a
- data ClusterNode = ClusterNode {}
- data ClusterTopology = ClusterTopology {
- topologySlots :: Vector ByteString
- topologyAddresses :: Vector NodeAddress
- topologyNodes :: Map ByteString ClusterNode
- topologyUpdateTime :: UTCTime
- data NodeAddress = NodeAddress {}
- data NodeRole
- data SlotRange = SlotRange {
- slotStart :: Word16
- slotEnd :: Word16
- slotMaster :: ByteString
- slotReplicas :: [ByteString]
- data ClusterClient (client :: ConnectionStatus -> Type) = ClusterClient {
- clusterTopology :: TVar ClusterTopology
- clusterConnectionPool :: ConnectionPool client
- clusterConfig :: ClusterConfig
- clusterConnector :: Connector client
- clusterRefreshLock :: MVar ()
- clusterMultiplexPool :: MultiplexPool client
- data ClusterCommandClient (client :: ConnectionStatus -> Type) a
- data ClusterConfig = ClusterConfig {}
- data ClusterError
- closeClusterClient :: forall (client :: ConnectionStatus -> Type). Client client => ClusterClient client -> IO ()
- createClusterClient :: Client client => ClusterConfig -> Connector client -> IO (ClusterClient client)
- refreshTopology :: forall (client :: ConnectionStatus -> Type). Client client => ClusterClient client -> IO ()
- runClusterCommandClient :: forall (client :: ConnectionStatus -> Type) a. Client client => ClusterClient client -> ClusterCommandClient client a -> IO a
- data ConnectionPool (client :: ConnectionStatus -> Type) = ConnectionPool {
- poolConnections :: MVar (Map NodeAddress (NodePool client))
- poolConfig :: PoolConfig
- data PoolConfig = PoolConfig {}
- closePool :: forall (client :: ConnectionStatus -> Type). Client client => ConnectionPool client -> IO ()
- createPool :: forall (client :: ConnectionStatus -> Type). PoolConfig -> IO (ConnectionPool client)
- withConnection :: Client client => ConnectionPool client -> NodeAddress -> Connector client -> (client 'Connected -> IO a) -> IO a
- data Multiplexer
- data MultiplexerException
- createMultiplexer :: Client client => client 'Connected -> IO ByteString -> IO Multiplexer
- destroyMultiplexer :: Multiplexer -> IO ()
- isMultiplexerAlive :: Multiplexer -> IO Bool
- submitCommand :: Multiplexer -> Builder -> IO RespData
- data MultiplexPool (client :: ConnectionStatus -> Type)
- closeMultiplexPool :: forall (client :: ConnectionStatus -> Type). MultiplexPool client -> IO ()
- createMultiplexPool :: Client client => Connector client -> Int -> IO (MultiplexPool client)
- submitToNode :: forall (client :: ConnectionStatus -> Type). Client client => MultiplexPool client -> NodeAddress -> Builder -> IO RespData
- data StandaloneClient
- data StandaloneCommandClient a
- data StandaloneConfig (client :: ConnectionStatus -> Type) = StandaloneConfig {
- standaloneNodeAddress :: !NodeAddress
- standaloneConnector :: !(Connector client)
- standaloneMultiplexerCount :: !Int
- closeStandaloneClient :: StandaloneClient -> IO ()
- createStandaloneClient :: Client client => Connector client -> NodeAddress -> IO StandaloneClient
- createStandaloneClientFromConfig :: forall (client :: ConnectionStatus -> Type). Client client => StandaloneConfig client -> IO StandaloneClient
- runStandaloneClient :: StandaloneClient -> StandaloneCommandClient a -> IO a
- type Connector (client :: ConnectionStatus -> Type) = NodeAddress -> IO (client 'Connected)
- clusterPlaintextConnector :: Connector PlainTextClient
- clusterTLSConnector :: String -> Connector TLSClient
- connectPlaintext :: String -> Int -> IO (PlainTextClient 'Connected)
- connectTLS :: String -> Int -> IO (TLSClient 'Connected)
- data ByteString
RESP Protocol
Constructors
| RespSimpleString :: !ByteString -> RespData | |
| RespError :: !ByteString -> RespData | |
| RespInteger :: !Integer -> RespData | |
| RespBulkString :: !ByteString -> RespData | |
| RespNullBulkString :: RespData | |
| RespArray :: ![RespData] -> RespData | |
| RespMap :: !(Map RespData RespData) -> RespData | |
| RespSet :: !(Set RespData) -> RespData |
Instances
| Show RespData | |
| Eq RespData | |
| Ord RespData | |
Defined in Database.Redis.Resp | |
| FromResp RespData | |
Defined in Database.Redis.FromResp | |
| Encodable RespData | |
Defined in Database.Redis.Resp | |
| FromResp [RespData] | |
Defined in Database.Redis.FromResp | |
parseRespData :: Parser RespData #
parseStrict :: ByteString -> Either String RespData #
Transport
class Client (client :: ConnectionStatus -> Type) where #
Methods
connect :: MonadIO m => client 'NotConnected -> m (client 'Connected) #
close :: MonadIO m => client 'Connected -> m () #
send :: MonadIO m => client 'Connected -> ByteString -> m () #
sendChunks :: MonadIO m => client 'Connected -> [ByteString] -> m () #
receive :: (MonadIO m, MonadFail m) => client 'Connected -> m ByteString #
Instances
| Client PlainTextClient | |
Defined in Database.Redis.Client Methods connect :: MonadIO m => PlainTextClient 'NotConnected -> m (PlainTextClient 'Connected) # close :: MonadIO m => PlainTextClient 'Connected -> m () # send :: MonadIO m => PlainTextClient 'Connected -> ByteString -> m () # sendChunks :: MonadIO m => PlainTextClient 'Connected -> [ByteString] -> m () # receive :: (MonadIO m, MonadFail m) => PlainTextClient 'Connected -> m ByteString # | |
| Client TLSClient | |
Defined in Database.Redis.Client Methods connect :: MonadIO m => TLSClient 'NotConnected -> m (TLSClient 'Connected) # close :: MonadIO m => TLSClient 'Connected -> m () # send :: MonadIO m => TLSClient 'Connected -> ByteString -> m () # sendChunks :: MonadIO m => TLSClient 'Connected -> [ByteString] -> m () # receive :: (MonadIO m, MonadFail m) => TLSClient 'Connected -> m ByteString # | |
data ConnectionStatus #
Constructors
| Connected | |
| NotConnected | |
| Server |
data PlainTextClient (a :: ConnectionStatus) where #
Constructors
| NotConnectedPlainTextClient :: String -> Maybe Int -> PlainTextClient 'NotConnected |
Instances
| Client PlainTextClient | |
Defined in Database.Redis.Client Methods connect :: MonadIO m => PlainTextClient 'NotConnected -> m (PlainTextClient 'Connected) # close :: MonadIO m => PlainTextClient 'Connected -> m () # send :: MonadIO m => PlainTextClient 'Connected -> ByteString -> m () # sendChunks :: MonadIO m => PlainTextClient 'Connected -> [ByteString] -> m () # receive :: (MonadIO m, MonadFail m) => PlainTextClient 'Connected -> m ByteString # | |
data TLSClient (a :: ConnectionStatus) where #
Constructors
| NotConnectedTLSClient :: String -> Maybe Int -> TLSClient 'NotConnected | |
| NotConnectedTLSClientWithHostname :: String -> String -> Maybe Int -> TLSClient 'NotConnected | |
| TLSTunnel :: TLSClient 'Connected -> TLSClient 'Server |
Instances
| Client TLSClient | |
Defined in Database.Redis.Client Methods connect :: MonadIO m => TLSClient 'NotConnected -> m (TLSClient 'Connected) # close :: MonadIO m => TLSClient 'Connected -> m () # send :: MonadIO m => TLSClient 'Connected -> ByteString -> m () # sendChunks :: MonadIO m => TLSClient 'Connected -> [ByteString] -> m () # receive :: (MonadIO m, MonadFail m) => TLSClient 'Connected -> m ByteString # | |
Redis Commands
class MonadIO m => RedisCommands (m :: Type -> Type) where #
Methods
auth :: FromResp a => ByteString -> ByteString -> m a #
set :: FromResp a => ByteString -> ByteString -> m a #
get :: FromResp a => ByteString -> m a #
mget :: FromResp a => [ByteString] -> m a #
setnx :: FromResp a => ByteString -> ByteString -> m a #
decr :: FromResp a => ByteString -> m a #
psetex :: FromResp a => ByteString -> Int -> ByteString -> m a #
bulkSet :: FromResp a => [(ByteString, ByteString)] -> m a #
flushAll :: FromResp a => m a #
del :: FromResp a => [ByteString] -> m a #
exists :: FromResp a => [ByteString] -> m a #
incr :: FromResp a => ByteString -> m a #
hset :: FromResp a => ByteString -> ByteString -> ByteString -> m a #
hget :: FromResp a => ByteString -> ByteString -> m a #
hmget :: FromResp a => ByteString -> [ByteString] -> m a #
hexists :: FromResp a => ByteString -> ByteString -> m a #
lpush :: FromResp a => ByteString -> [ByteString] -> m a #
lrange :: FromResp a => ByteString -> Int -> Int -> m a #
expire :: FromResp a => ByteString -> Int -> m a #
ttl :: FromResp a => ByteString -> m a #
rpush :: FromResp a => ByteString -> [ByteString] -> m a #
lpop :: FromResp a => ByteString -> m a #
rpop :: FromResp a => ByteString -> m a #
sadd :: FromResp a => ByteString -> [ByteString] -> m a #
smembers :: FromResp a => ByteString -> m a #
scard :: FromResp a => ByteString -> m a #
sismember :: FromResp a => ByteString -> ByteString -> m a #
hdel :: FromResp a => ByteString -> [ByteString] -> m a #
hkeys :: FromResp a => ByteString -> m a #
hvals :: FromResp a => ByteString -> m a #
llen :: FromResp a => ByteString -> m a #
lindex :: FromResp a => ByteString -> Int -> m a #
clientSetInfo :: FromResp a => [ByteString] -> m a #
clientReply :: ClientReplyValues -> m (Maybe RespData) #
zadd :: FromResp a => ByteString -> [(Int, ByteString)] -> m a #
zrange :: FromResp a => ByteString -> Int -> Int -> Bool -> m a #
geoadd :: FromResp a => ByteString -> [(Double, Double, ByteString)] -> m a #
geodist :: FromResp a => ByteString -> ByteString -> ByteString -> Maybe GeoUnit -> m a #
geohash :: FromResp a => ByteString -> [ByteString] -> m a #
geopos :: FromResp a => ByteString -> [ByteString] -> m a #
georadius :: FromResp a => ByteString -> Double -> Double -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a #
georadiusRo :: FromResp a => ByteString -> Double -> Double -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a #
georadiusByMember :: FromResp a => ByteString -> ByteString -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a #
georadiusByMemberRo :: FromResp a => ByteString -> ByteString -> Double -> GeoUnit -> [GeoRadiusFlag] -> m a #
geosearch :: FromResp a => ByteString -> GeoSearchFrom -> GeoSearchBy -> [GeoSearchOption] -> m a #
geosearchstore :: FromResp a => ByteString -> ByteString -> GeoSearchFrom -> GeoSearchBy -> [GeoSearchOption] -> Bool -> m a #
clusterSlots :: FromResp a => m a #
Instances
data ClientState (client :: ConnectionStatus -> Type) #
Constructors
| ClientState | |
Fields
| |
Instances
| Client client => MonadState (ClientState client) (RedisCommandClient client) | |
Defined in Database.Redis.Command Methods get :: RedisCommandClient client (ClientState client) # put :: ClientState client -> RedisCommandClient client () # state :: (ClientState client -> (a, ClientState client)) -> RedisCommandClient client a # | |
data ClientReplyValues #
Instances
| Show ClientReplyValues | |
Defined in Database.Redis.Command Methods showsPrec :: Int -> ClientReplyValues -> ShowS # show :: ClientReplyValues -> String # showList :: [ClientReplyValues] -> ShowS # | |
| Eq ClientReplyValues | |
Defined in Database.Redis.Command Methods (==) :: ClientReplyValues -> ClientReplyValues -> Bool # (/=) :: ClientReplyValues -> ClientReplyValues -> Bool # | |
data RedisCommandClient (client :: ConnectionStatus -> Type) a where #
Constructors
| RedisCommandClient | |
Fields
| |
Instances
data RedisError #
Constructors
| ParseError String | |
| ConnectionClosed | |
| UnexpectedResp RespData |
Instances
| Exception RedisError | |
Defined in Database.Redis.RedisError Methods toException :: RedisError -> SomeException # fromException :: SomeException -> Maybe RedisError # displayException :: RedisError -> String # backtraceDesired :: RedisError -> Bool # | |
| Show RedisError | |
Defined in Database.Redis.RedisError Methods showsPrec :: Int -> RedisError -> ShowS # show :: RedisError -> String # showList :: [RedisError] -> ShowS # | |
| Eq RedisError | |
Defined in Database.Redis.RedisError | |
convertResp :: (FromResp a, MonadIO m) => RespData -> m a #
encodeBulkArg :: ByteString -> Builder #
encodeCommand :: [ByteString] -> ByteString #
encodeCommandBuilder :: [ByteString] -> Builder #
encodeGetBuilder :: ByteString -> Builder #
encodeSetBuilder :: ByteString -> ByteString -> Builder #
parseManyWith :: forall (client :: ConnectionStatus -> Type) m. (Client client, MonadIO m, MonadState (ClientState client) m) => Int -> m ByteString -> m [RespData] #
parseWith :: forall (client :: ConnectionStatus -> Type) m. (Client client, MonadIO m, MonadState (ClientState client) m) => m ByteString -> m RespData #
showBS :: Show a => a -> ByteString #
FromResp conversion
Methods
fromResp :: RespData -> Either RedisError a #
Instances
| FromResp ByteString | |
Defined in Database.Redis.FromResp Methods fromResp :: RespData -> Either RedisError ByteString # | |
| FromResp RespData | |
Defined in Database.Redis.FromResp | |
| FromResp Text | |
Defined in Database.Redis.FromResp | |
| FromResp Integer | |
Defined in Database.Redis.FromResp | |
| FromResp () | |
Defined in Database.Redis.FromResp Methods fromResp :: RespData -> Either RedisError () # | |
| FromResp Bool | |
Defined in Database.Redis.FromResp | |
| FromResp (Maybe ByteString) | |
Defined in Database.Redis.FromResp Methods fromResp :: RespData -> Either RedisError (Maybe ByteString) # | |
| FromResp (Maybe Text) | |
Defined in Database.Redis.FromResp | |
| FromResp [ByteString] | |
Defined in Database.Redis.FromResp Methods fromResp :: RespData -> Either RedisError [ByteString] # | |
| FromResp [RespData] | |
Defined in Database.Redis.FromResp | |
Cluster
data ClusterNode #
Constructors
| ClusterNode | |
Fields
| |
Instances
| Show ClusterNode | |
Defined in Database.Redis.Cluster Methods showsPrec :: Int -> ClusterNode -> ShowS # show :: ClusterNode -> String # showList :: [ClusterNode] -> ShowS # | |
| Eq ClusterNode | |
Defined in Database.Redis.Cluster | |
data ClusterTopology #
Constructors
| ClusterTopology | |
Fields
| |
Instances
| Show ClusterTopology | |
Defined in Database.Redis.Cluster Methods showsPrec :: Int -> ClusterTopology -> ShowS # show :: ClusterTopology -> String # showList :: [ClusterTopology] -> ShowS # | |
data NodeAddress #
Constructors
| NodeAddress | |
Instances
| Show NodeAddress | |
Defined in Database.Redis.Cluster Methods showsPrec :: Int -> NodeAddress -> ShowS # show :: NodeAddress -> String # showList :: [NodeAddress] -> ShowS # | |
| Eq NodeAddress | |
Defined in Database.Redis.Cluster | |
| Ord NodeAddress | |
Defined in Database.Redis.Cluster Methods compare :: NodeAddress -> NodeAddress -> Ordering # (<) :: NodeAddress -> NodeAddress -> Bool # (<=) :: NodeAddress -> NodeAddress -> Bool # (>) :: NodeAddress -> NodeAddress -> Bool # (>=) :: NodeAddress -> NodeAddress -> Bool # max :: NodeAddress -> NodeAddress -> NodeAddress # min :: NodeAddress -> NodeAddress -> NodeAddress # | |
Constructors
| SlotRange | |
Fields
| |
Instances
data ClusterClient (client :: ConnectionStatus -> Type) #
Constructors
| ClusterClient | |
Fields
| |
Instances
| Client client => MonadState (ClusterClient client) (ClusterCommandClient client) | |
Defined in Database.Redis.Cluster.Client Methods get :: ClusterCommandClient client (ClusterClient client) # put :: ClusterClient client -> ClusterCommandClient client () # state :: (ClusterClient client -> (a, ClusterClient client)) -> ClusterCommandClient client a # | |
data ClusterCommandClient (client :: ConnectionStatus -> Type) a #
Instances
data ClusterConfig #
Constructors
| ClusterConfig | |
Instances
| Show ClusterConfig | |
Defined in Database.Redis.Cluster.Client Methods showsPrec :: Int -> ClusterConfig -> ShowS # show :: ClusterConfig -> String # showList :: [ClusterConfig] -> ShowS # | |
data ClusterError #
Constructors
| MovedError Word16 NodeAddress | |
| AskError Word16 NodeAddress | |
| ClusterDownError String | |
| TryAgainError String | |
| CrossSlotError String | |
| MaxRetriesExceeded String | |
| TopologyError String | |
| ConnectionError String |
Instances
| Show ClusterError | |
Defined in Database.Redis.Cluster.Client Methods showsPrec :: Int -> ClusterError -> ShowS # show :: ClusterError -> String # showList :: [ClusterError] -> ShowS # | |
| Eq ClusterError | |
Defined in Database.Redis.Cluster.Client | |
closeClusterClient :: forall (client :: ConnectionStatus -> Type). Client client => ClusterClient client -> IO () #
createClusterClient :: Client client => ClusterConfig -> Connector client -> IO (ClusterClient client) #
refreshTopology :: forall (client :: ConnectionStatus -> Type). Client client => ClusterClient client -> IO () #
runClusterCommandClient :: forall (client :: ConnectionStatus -> Type) a. Client client => ClusterClient client -> ClusterCommandClient client a -> IO a #
data ConnectionPool (client :: ConnectionStatus -> Type) #
Constructors
| ConnectionPool | |
Fields
| |
data PoolConfig #
Constructors
| PoolConfig | |
Fields
| |
Instances
| Show PoolConfig | |
Defined in Database.Redis.Cluster.ConnectionPool Methods showsPrec :: Int -> PoolConfig -> ShowS # show :: PoolConfig -> String # showList :: [PoolConfig] -> ShowS # | |
closePool :: forall (client :: ConnectionStatus -> Type). Client client => ConnectionPool client -> IO () #
createPool :: forall (client :: ConnectionStatus -> Type). PoolConfig -> IO (ConnectionPool client) #
withConnection :: Client client => ConnectionPool client -> NodeAddress -> Connector client -> (client 'Connected -> IO a) -> IO a #
Multiplexing
data Multiplexer #
data MultiplexerException #
Instances
| Exception MultiplexerException | |
Defined in Database.Redis.Internal.Multiplexer | |
| Show MultiplexerException | |
Defined in Database.Redis.Internal.Multiplexer Methods showsPrec :: Int -> MultiplexerException -> ShowS # show :: MultiplexerException -> String # showList :: [MultiplexerException] -> ShowS # | |
createMultiplexer :: Client client => client 'Connected -> IO ByteString -> IO Multiplexer #
destroyMultiplexer :: Multiplexer -> IO () #
isMultiplexerAlive :: Multiplexer -> IO Bool #
submitCommand :: Multiplexer -> Builder -> IO RespData #
data MultiplexPool (client :: ConnectionStatus -> Type) #
closeMultiplexPool :: forall (client :: ConnectionStatus -> Type). MultiplexPool client -> IO () #
createMultiplexPool :: Client client => Connector client -> Int -> IO (MultiplexPool client) #
submitToNode :: forall (client :: ConnectionStatus -> Type). Client client => MultiplexPool client -> NodeAddress -> Builder -> IO RespData #
Standalone Multiplexed Client
data StandaloneClient #
data StandaloneCommandClient a #
Instances
data StandaloneConfig (client :: ConnectionStatus -> Type) #
Constructors
| StandaloneConfig | |
Fields
| |
closeStandaloneClient :: StandaloneClient -> IO () #
createStandaloneClient :: Client client => Connector client -> NodeAddress -> IO StandaloneClient #
createStandaloneClientFromConfig :: forall (client :: ConnectionStatus -> Type). Client client => StandaloneConfig client -> IO StandaloneClient #
runStandaloneClient :: StandaloneClient -> StandaloneCommandClient a -> IO a #
Connection Helpers
type Connector (client :: ConnectionStatus -> Type) = NodeAddress -> IO (client 'Connected) #
connectPlaintext :: String -> Int -> IO (PlainTextClient 'Connected) #
ByteString (re-exported for convenience)
data ByteString #
A space-efficient representation of a Word8 vector, supporting many
efficient operations.
A ByteString contains 8-bit bytes, or by using the operations from
Data.ByteString.Char8 it can be interpreted as containing 8-bit
characters.