hedis-0.15.2: Client library for the Redis datastore: supports full command set, pipelining.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Database.Redis.Sentinel

Contents

- Connection
- runRedis with Sentinel support
- Re-export Database.Redis

Description

Database.Redis like interface with connection through Redis Sentinel.

More details here: https://redis.io/topics/sentinel.

Example:

    conn <- connect SentinelConnectionInfo (("localhost", PortNumber 26379) :| []) "mymaster" defaultConnectInfo

    runRedis conn $ do
      set "hello" "world"

When connection is opened, the Sentinels will be queried to get current master. Subsequent `runRedis` calls will talk to that master.

If `runRedis` call fails, the next call will choose a new master to talk to.

This implementation is based on Gist by Emanuel Borsboom at https://gist.github.com/borsboom/681d37d273d5c4168723

Synopsis

- data SentinelConnectInfo = SentinelConnectInfo {
  - connectSentinels :: NonEmpty (HostName, PortID)
  - connectMasterName :: ByteString
  - connectBaseInfo :: ConnectInfo
  }
- data SentinelConnection
- connect :: SentinelConnectInfo -> IO SentinelConnection
- runRedis :: SentinelConnection -> Redis (Either Reply a) -> IO (Either Reply a)
- data RedisSentinelException = NoSentinels (NonEmpty (HostName, PortID))
- data Message
  - = Message {
    - msgChannel, msgMessage :: ByteString
    }
  - | PMessage {
    - msgPattern, msgChannel, msgMessage :: ByteString
    }
- data Reply
  - = SingleLine ByteString
  - | Error ByteString
  - | Integer Integer
  - | Bulk (Maybe ByteString)
  - | MultiBulk (Maybe [Reply])
- data Redis a
- class MonadRedis m => RedisCtx m f | m -> f where
  - returnDecode :: RedisResult a => Reply -> m (f a)
- class Monad m => MonadRedis m where
  - liftRedis :: Redis a -> m a
- data ConnectError
  - = ConnectAuthError Reply
  - | ConnectSelectError Reply
- data ConnectInfo = ConnInfo {
  - connectHost :: HostName
  - connectPort :: PortID
  - connectAuth :: Maybe ByteString
  - connectDatabase :: Integer
  - connectMaxConnections :: Int
  - connectMaxIdleTime :: NominalDiffTime
  - connectTimeout :: Maybe NominalDiffTime
  - connectTLSParams :: Maybe ClientParams
  }
- data PortID
  - = PortNumber PortNumber
  - | UnixSocket String
- data PubSub
- data Status
  - = Ok
  - | Pong
  - | Status ByteString
- class RedisResult a where
  - decode :: Reply -> Either Reply a
- data ConnectionLostException = ConnectionLost
- newtype ConnectTimeout = ConnectTimeout ConnectPhase
- data HashSlot
- data ClusterSlotsResponse = ClusterSlotsResponse {
  - clusterSlotsResponseEntries :: [ClusterSlotsResponseEntry]
  }
- data ClusterSlotsResponseEntry = ClusterSlotsResponseEntry {
  - clusterSlotsResponseEntryStartSlot :: Int
  - clusterSlotsResponseEntryEndSlot :: Int
  - clusterSlotsResponseEntryMaster :: ClusterSlotsNode
  - clusterSlotsResponseEntryReplicas :: [ClusterSlotsNode]
  }
- data ClusterSlotsNode = ClusterSlotsNode {
  - clusterSlotsNodeIP :: ByteString
  - clusterSlotsNodePort :: Int
  - clusterSlotsNodeID :: ByteString
  }
- type RedisChannel = ByteString
- type RedisPChannel = ByteString
- type MessageCallback = ByteString -> IO ()
- type PMessageCallback = RedisChannel -> ByteString -> IO ()
- data PubSubController
- type UnregisterCallbacksAction = IO ()
- data Queued a
- data TxResult a
  - = TxSuccess a
  - | TxAborted
  - | TxError String
- data RedisTx a
- data MigrateOpts = MigrateOpts {
  - migrateCopy :: Bool
  - migrateReplace :: Bool
  }
- data Cursor
- data ScanOpts = ScanOpts {
  - scanMatch :: Maybe ByteString
  - scanCount :: Maybe Integer
  }
- data SortOpts = SortOpts {
  - sortBy :: Maybe ByteString
  - sortLimit :: (Integer, Integer)
  - sortGet :: [ByteString]
  - sortOrder :: SortOrder
  - sortAlpha :: Bool
  }
- data SortOrder
  - = Asc
  - | Desc
- data RedisType
  - = None
  - | String
  - | Hash
  - | List
  - | Set
  - | ZSet
- data DebugMode
- data ReplyMode
- data Slowlog = Slowlog {
  - slowlogId :: Integer
  - slowlogTimestamp :: Integer
  - slowlogMicros :: Integer
  - slowlogCmd :: [ByteString]
  - slowlogClientIpAndPort :: Maybe ByteString
  - slowlogClientName :: Maybe ByteString
  }
- data ZaddOpts = ZaddOpts {
  - zaddCondition :: Maybe Condition
  - zaddChange :: Bool
  - zaddIncrement :: Bool
  }
- data Aggregate
  - = Sum
  - | Min
  - | Max
- data RangeLex a
  - = Incl a
  - | Excl a
  - | Minr
  - | Maxr
- data Condition
  - = Nx
  - | Xx
- data SetOpts = SetOpts {
  - setSeconds :: Maybe Integer
  - setMilliseconds :: Maybe Integer
  - setCondition :: Maybe Condition
  }
- data XReadOpts = XReadOpts {
  - block :: Maybe Integer
  - recordCount :: Maybe Integer
  }
- data XReadResponse = XReadResponse {
  - stream :: ByteString
  - records :: [StreamsRecord]
  }
- data StreamsRecord = StreamsRecord {
  - recordId :: ByteString
  - keyValues :: [(ByteString, ByteString)]
  }
- data TrimOpts
  - = NoArgs
  - | Maxlen Integer
  - | ApproxMaxlen Integer
- data XPendingSummaryResponse = XPendingSummaryResponse {
  - numPendingMessages :: Integer
  - smallestPendingMessageId :: ByteString
  - largestPendingMessageId :: ByteString
  - numPendingMessagesByconsumer :: [(ByteString, Integer)]
  }
- data XPendingDetailRecord = XPendingDetailRecord {
  - messageId :: ByteString
  - consumer :: ByteString
  - millisSinceLastDelivered :: Integer
  - numTimesDelivered :: Integer
  }
- data XClaimOpts = XClaimOpts {
  - xclaimIdle :: Maybe Integer
  - xclaimTime :: Maybe Integer
  - xclaimRetryCount :: Maybe Integer
  - xclaimForce :: Bool
  }
- data XInfoConsumersResponse = XInfoConsumersResponse {
  - xinfoConsumerName :: ByteString
  - xinfoConsumerNumPendingMessages :: Integer
  - xinfoConsumerIdleTime :: Integer
  }
- data XInfoGroupsResponse = XInfoGroupsResponse {
  - xinfoGroupsGroupName :: ByteString
  - xinfoGroupsNumConsumers :: Integer
  - xinfoGroupsNumPendingMessages :: Integer
  - xinfoGroupsLastDeliveredMessageId :: ByteString
  }
- data XInfoStreamResponse
  - = XInfoStreamResponse {
    - xinfoStreamLength :: Integer
    - xinfoStreamRadixTreeKeys :: Integer
    - xinfoStreamRadixTreeNodes :: Integer
    - xinfoStreamNumGroups :: Integer
    - xinfoStreamLastEntryId :: ByteString
    - xinfoStreamFirstEntry :: StreamsRecord
    - xinfoStreamLastEntry :: StreamsRecord
    }
  - | XInfoStreamEmptyResponse {
    - xinfoStreamLength :: Integer
    - xinfoStreamRadixTreeKeys :: Integer
    - xinfoStreamRadixTreeNodes :: Integer
    - xinfoStreamNumGroups :: Integer
    - xinfoStreamLastEntryId :: ByteString
    }
- data ClusterNodesResponse = ClusterNodesResponse {
  - clusterNodesResponseEntries :: [ClusterNodesResponseEntry]
  }
- data ClusterNodesResponseEntry = ClusterNodesResponseEntry {
  - clusterNodesResponseNodeId :: ByteString
  - clusterNodesResponseNodeIp :: ByteString
  - clusterNodesResponseNodePort :: Integer
  - clusterNodesResponseNodeFlags :: [ByteString]
  - clusterNodesResponseMasterId :: Maybe ByteString
  - clusterNodesResponsePingSent :: Integer
  - clusterNodesResponsePongReceived :: Integer
  - clusterNodesResponseConfigEpoch :: Integer
  - clusterNodesResponseLinkState :: ByteString
  - clusterNodesResponseSlots :: [ClusterNodesResponseSlotSpec]
  }
- data ClusterNodesResponseSlotSpec
  - = ClusterNodesResponseSingleSlot Integer
  - | ClusterNodesResponseSlotRange Integer Integer
  - | ClusterNodesResponseSlotImporting Integer ByteString
  - | ClusterNodesResponseSlotMigrating Integer ByteString
- time :: RedisCtx m f => m (f (Integer, Integer))
- wait :: RedisCtx m f => Integer -> Integer -> m (f Integer)
- get :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
- sort :: RedisCtx m f => ByteString -> SortOpts -> m (f [ByteString])
- migrate :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> Integer -> m (f Status)
- append :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
- bitcount :: RedisCtx m f => ByteString -> m (f Integer)
- keys :: RedisCtx m f => ByteString -> m (f [ByteString])
- scan :: RedisCtx m f => Cursor -> m (f (Cursor, [ByteString]))
- select :: RedisCtx m f => Integer -> m (f Status)
- rename :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
- set :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
- move :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
- unRedis :: Redis a -> ReaderT RedisEnv IO a
- reRedis :: ReaderT RedisEnv IO a -> Redis a
- checkedConnect :: ConnectInfo -> IO Connection
- disconnect :: Connection -> IO ()
- withConnect :: (MonadMask m, MonadIO m) => ConnectInfo -> (Connection -> m c) -> m c
- withCheckedConnect :: ConnectInfo -> (Connection -> IO c) -> IO c
- defaultConnectInfo :: ConnectInfo
- parseConnectInfo :: String -> Either String ConnectInfo
- connectCluster :: ConnectInfo -> IO Connection
- sendRequest :: (RedisCtx m f, RedisResult a) => [ByteString] -> m (f a)
- keyToSlot :: ByteString -> HashSlot
- ping :: RedisCtx m f => m (f Status)
- auth :: RedisCtx m f => ByteString -> m (f Status)
- clusterSlots :: RedisCtx m f => m (f ClusterSlotsResponse)
- command :: RedisCtx m f => m (f [CommandInfo])
- publish :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
- pubSub :: PubSub -> (Message -> IO PubSub) -> Redis ()
- subscribe :: [ByteString] -> PubSub
- unsubscribe :: [ByteString] -> PubSub
- psubscribe :: [ByteString] -> PubSub
- punsubscribe :: [ByteString] -> PubSub
- pubSubForever :: Connection -> PubSubController -> IO () -> IO ()
- newPubSubController :: MonadIO m => [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m PubSubController
- currentChannels :: MonadIO m => PubSubController -> m [RedisChannel]
- currentPChannels :: MonadIO m => PubSubController -> m [RedisPChannel]
- addChannels :: MonadIO m => PubSubController -> [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m UnregisterCallbacksAction
- addChannelsAndWait :: MonadIO m => PubSubController -> [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m UnregisterCallbacksAction
- removeChannels :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m ()
- removeChannelsAndWait :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m ()
- watch :: [ByteString] -> Redis (Either Reply Status)
- unwatch :: Redis (Either Reply Status)
- multiExec :: RedisTx (Queued a) -> Redis (TxResult a)
- echo :: RedisCtx m f => ByteString -> m (f ByteString)
- quit :: RedisCtx m f => m (f Status)
- del :: RedisCtx m f => [ByteString] -> m (f Integer)
- dump :: RedisCtx m f => ByteString -> m (f ByteString)
- exists :: RedisCtx m f => ByteString -> m (f Bool)
- expire :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
- expireat :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
- defaultMigrateOpts :: MigrateOpts
- migrateMultiple :: RedisCtx m f => ByteString -> ByteString -> Integer -> Integer -> MigrateOpts -> [ByteString] -> m (f Status)
- objectRefcount :: RedisCtx m f => ByteString -> m (f Integer)
- objectEncoding :: RedisCtx m f => ByteString -> m (f ByteString)
- objectIdletime :: RedisCtx m f => ByteString -> m (f Integer)
- persist :: RedisCtx m f => ByteString -> m (f Bool)
- pexpire :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
- pexpireat :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
- pttl :: RedisCtx m f => ByteString -> m (f Integer)
- randomkey :: RedisCtx m f => m (f (Maybe ByteString))
- renamenx :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
- restore :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
- restoreReplace :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
- cursor0 :: Cursor
- defaultScanOpts :: ScanOpts
- scanOpts :: RedisCtx m f => Cursor -> ScanOpts -> m (f (Cursor, [ByteString]))
- defaultSortOpts :: SortOpts
- sortStore :: RedisCtx m f => ByteString -> ByteString -> SortOpts -> m (f Integer)
- ttl :: RedisCtx m f => ByteString -> m (f Integer)
- getType :: RedisCtx m f => ByteString -> m (f RedisType)
- hdel :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- hexists :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
- hget :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
- hgetall :: RedisCtx m f => ByteString -> m (f [(ByteString, ByteString)])
- hincrby :: RedisCtx m f => ByteString -> ByteString -> Integer -> m (f Integer)
- hincrbyfloat :: RedisCtx m f => ByteString -> ByteString -> Double -> m (f Double)
- hkeys :: RedisCtx m f => ByteString -> m (f [ByteString])
- hlen :: RedisCtx m f => ByteString -> m (f Integer)
- hmget :: RedisCtx m f => ByteString -> [ByteString] -> m (f [Maybe ByteString])
- hmset :: RedisCtx m f => ByteString -> [(ByteString, ByteString)] -> m (f Status)
- hscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [(ByteString, ByteString)]))
- hscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [(ByteString, ByteString)]))
- hset :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
- hsetnx :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Bool)
- hstrlen :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
- hvals :: RedisCtx m f => ByteString -> m (f [ByteString])
- pfadd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- pfcount :: RedisCtx m f => [ByteString] -> m (f Integer)
- pfmerge :: RedisCtx m f => ByteString -> [ByteString] -> m (f ByteString)
- blpop :: RedisCtx m f => [ByteString] -> Integer -> m (f (Maybe (ByteString, ByteString)))
- brpop :: RedisCtx m f => [ByteString] -> Integer -> m (f (Maybe (ByteString, ByteString)))
- brpoplpush :: RedisCtx m f => ByteString -> ByteString -> Integer -> m (f (Maybe ByteString))
- lindex :: RedisCtx m f => ByteString -> Integer -> m (f (Maybe ByteString))
- linsertBefore :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
- linsertAfter :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
- llen :: RedisCtx m f => ByteString -> m (f Integer)
- lpop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
- lpush :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- lpushx :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
- lrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
- lrem :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
- lset :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
- ltrim :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Status)
- rpop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
- rpoplpush :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
- rpush :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- rpushx :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
- eval :: (RedisCtx m f, RedisResult a) => ByteString -> [ByteString] -> [ByteString] -> m (f a)
- evalsha :: (RedisCtx m f, RedisResult a) => ByteString -> [ByteString] -> [ByteString] -> m (f a)
- scriptDebug :: RedisCtx m f => DebugMode -> m (f Bool)
- scriptExists :: RedisCtx m f => [ByteString] -> m (f [Bool])
- scriptFlush :: RedisCtx m f => m (f Status)
- scriptKill :: RedisCtx m f => m (f Status)
- scriptLoad :: RedisCtx m f => ByteString -> m (f ByteString)
- bgrewriteaof :: RedisCtx m f => m (f Status)
- bgsave :: RedisCtx m f => m (f Status)
- clientGetname :: RedisCtx m f => m (f Status)
- clientList :: RedisCtx m f => m (f [ByteString])
- clientPause :: RedisCtx m f => Integer -> m (f Status)
- clientReply :: RedisCtx m f => ReplyMode -> m (f Bool)
- clientSetname :: RedisCtx m f => ByteString -> m (f ByteString)
- commandCount :: RedisCtx m f => m (f Integer)
- commandInfo :: RedisCtx m f => [ByteString] -> m (f [ByteString])
- configGet :: RedisCtx m f => ByteString -> m (f [(ByteString, ByteString)])
- configResetstat :: RedisCtx m f => m (f Status)
- configRewrite :: RedisCtx m f => m (f Status)
- configSet :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
- dbsize :: RedisCtx m f => m (f Integer)
- debugObject :: RedisCtx m f => ByteString -> m (f ByteString)
- flushall :: RedisCtx m f => m (f Status)
- flushdb :: RedisCtx m f => m (f Status)
- info :: RedisCtx m f => m (f ByteString)
- infoSection :: RedisCtx m f => ByteString -> m (f ByteString)
- lastsave :: RedisCtx m f => m (f Integer)
- save :: RedisCtx m f => m (f Status)
- slaveof :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
- slowlogGet :: RedisCtx m f => Integer -> m (f [Slowlog])
- slowlogLen :: RedisCtx m f => m (f Integer)
- slowlogReset :: RedisCtx m f => m (f Status)
- sadd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- scard :: RedisCtx m f => ByteString -> m (f Integer)
- sdiff :: RedisCtx m f => [ByteString] -> m (f [ByteString])
- sdiffstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- sinter :: RedisCtx m f => [ByteString] -> m (f [ByteString])
- sinterstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- sismember :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
- smembers :: RedisCtx m f => ByteString -> m (f [ByteString])
- smove :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Bool)
- spop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
- spopN :: RedisCtx m f => ByteString -> Integer -> m (f [ByteString])
- srandmember :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
- srandmemberN :: RedisCtx m f => ByteString -> Integer -> m (f [ByteString])
- srem :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- sscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [ByteString]))
- sscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [ByteString]))
- sunion :: RedisCtx m f => [ByteString] -> m (f [ByteString])
- sunionstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- defaultZaddOpts :: ZaddOpts
- zadd :: RedisCtx m f => ByteString -> [(Double, ByteString)] -> m (f Integer)
- zaddOpts :: RedisCtx m f => ByteString -> [(Double, ByteString)] -> ZaddOpts -> m (f Integer)
- zcard :: RedisCtx m f => ByteString -> m (f Integer)
- zcount :: RedisCtx m f => ByteString -> Double -> Double -> m (f Integer)
- zincrby :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Double)
- zinterstore :: RedisCtx m f => ByteString -> [ByteString] -> Aggregate -> m (f Integer)
- zinterstoreWeights :: RedisCtx m f => ByteString -> [(ByteString, Double)] -> Aggregate -> m (f Integer)
- zlexcount :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
- zrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
- zrangeWithscores :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [(ByteString, Double)])
- zrangebylex :: RedisCtx m f => ByteString -> RangeLex ByteString -> RangeLex ByteString -> m (f [ByteString])
- zrangebylexLimit :: RedisCtx m f => ByteString -> RangeLex ByteString -> RangeLex ByteString -> Integer -> Integer -> m (f [ByteString])
- zrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f [ByteString])
- zrangebyscoreWithscores :: RedisCtx m f => ByteString -> Double -> Double -> m (f [(ByteString, Double)])
- zrangebyscoreLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [ByteString])
- zrangebyscoreWithscoresLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [(ByteString, Double)])
- zrank :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Integer))
- zrem :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- zremrangebylex :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
- zremrangebyrank :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Integer)
- zremrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f Integer)
- zrevrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
- zrevrangeWithscores :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [(ByteString, Double)])
- zrevrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f [ByteString])
- zrevrangebyscoreWithscores :: RedisCtx m f => ByteString -> Double -> Double -> m (f [(ByteString, Double)])
- zrevrangebyscoreLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [ByteString])
- zrevrangebyscoreWithscoresLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [(ByteString, Double)])
- zrevrank :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Integer))
- zscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [(ByteString, Double)]))
- zscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [(ByteString, Double)]))
- zscore :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Double))
- zunionstore :: RedisCtx m f => ByteString -> [ByteString] -> Aggregate -> m (f Integer)
- zunionstoreWeights :: RedisCtx m f => ByteString -> [(ByteString, Double)] -> Aggregate -> m (f Integer)
- bitcountRange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Integer)
- bitopAnd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- bitopOr :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- bitopXor :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- bitopNot :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
- bitpos :: RedisCtx m f => ByteString -> Integer -> Integer -> Integer -> m (f Integer)
- decr :: RedisCtx m f => ByteString -> m (f Integer)
- decrby :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
- getbit :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
- getrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f ByteString)
- getset :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
- incr :: RedisCtx m f => ByteString -> m (f Integer)
- incrby :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
- incrbyfloat :: RedisCtx m f => ByteString -> Double -> m (f Double)
- mget :: RedisCtx m f => [ByteString] -> m (f [Maybe ByteString])
- mset :: RedisCtx m f => [(ByteString, ByteString)] -> m (f Status)
- msetnx :: RedisCtx m f => [(ByteString, ByteString)] -> m (f Bool)
- psetex :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
- setOpts :: RedisCtx m f => ByteString -> ByteString -> SetOpts -> m (f Status)
- setbit :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
- setex :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
- setnx :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
- setrange :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
- strlen :: RedisCtx m f => ByteString -> m (f Integer)
- defaultXreadOpts :: XReadOpts
- xadd :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> m (f ByteString)
- xaddOpts :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> TrimOpts -> m (f ByteString)
- xread :: RedisCtx m f => [(ByteString, ByteString)] -> m (f (Maybe [XReadResponse]))
- xreadOpts :: RedisCtx m f => [(ByteString, ByteString)] -> XReadOpts -> m (f (Maybe [XReadResponse]))
- xreadGroup :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> m (f (Maybe [XReadResponse]))
- xreadGroupOpts :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> XReadOpts -> m (f (Maybe [XReadResponse]))
- xack :: RedisCtx m f => ByteString -> ByteString -> [ByteString] -> m (f Integer)
- xgroupCreate :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Status)
- xgroupSetId :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Status)
- xgroupDestroy :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
- xgroupDelConsumer :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
- xrange :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Maybe Integer -> m (f [StreamsRecord])
- xrevRange :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Maybe Integer -> m (f [StreamsRecord])
- xlen :: RedisCtx m f => ByteString -> m (f Integer)
- xpendingSummary :: RedisCtx m f => ByteString -> ByteString -> Maybe ByteString -> m (f XPendingSummaryResponse)
- xpendingDetail :: RedisCtx m f => ByteString -> ByteString -> ByteString -> ByteString -> Integer -> Maybe ByteString -> m (f [XPendingDetailRecord])
- defaultXClaimOpts :: XClaimOpts
- xclaim :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> XClaimOpts -> [ByteString] -> m (f [StreamsRecord])
- xclaimJustIds :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> XClaimOpts -> [ByteString] -> m (f [ByteString])
- xinfoConsumers :: RedisCtx m f => ByteString -> ByteString -> m (f [XInfoConsumersResponse])
- xinfoGroups :: RedisCtx m f => ByteString -> m (f [XInfoGroupsResponse])
- xinfoStream :: RedisCtx m f => ByteString -> m (f XInfoStreamResponse)
- xdel :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
- xtrim :: RedisCtx m f => ByteString -> TrimOpts -> m (f Integer)
- inf :: RealFloat a => a
- clusterNodes :: RedisCtx m f => m (f ClusterNodesResponse)
- clusterSetSlotNode :: RedisCtx m f => Integer -> ByteString -> m (f Status)
- clusterSetSlotStable :: RedisCtx m f => Integer -> m (f Status)
- clusterSetSlotImporting :: RedisCtx m f => Integer -> ByteString -> m (f Status)
- clusterSetSlotMigrating :: RedisCtx m f => Integer -> ByteString -> m (f Status)
- clusterGetKeysInSlot :: RedisCtx m f => Integer -> Integer -> m (f [ByteString])

# Connection

data SentinelConnectInfo Source #

Configuration of Sentinel hosts.

Constructors

SentinelConnectInfo |

Fields

- connectSentinels :: NonEmpty (HostName, PortID)

  List of sentinels.

- connectMasterName :: ByteString

  Name of master to connect to.

- connectBaseInfo :: ConnectInfo

  This is used to configure auth and other parameters for Redis connection, but `connectHost` and `connectPort` are ignored.

#### Instances

Instances details

Show SentinelConnectInfo Source # |
Instance details Defined in Database.Redis.Sentinel Methods showsPrec :: Int -> SentinelConnectInfo -> ShowS Source # show :: SentinelConnectInfo -> String Source # showList :: [SentinelConnectInfo] -> ShowS Source #

data SentinelConnection Source #

connect :: SentinelConnectInfo -> IO SentinelConnection Source #

# runRedis with Sentinel support

runRedis :: SentinelConnection -> Redis (Either Reply a) -> IO (Either Reply a) Source #

Interact with a Redis datastore. See `runRedis` for details.

data RedisSentinelException Source #

Exception thrown by Database.Redis.Sentinel.

Constructors

NoSentinels (NonEmpty (HostName, PortID)) | Thrown if no sentinel can be reached.

#### Instances

Instances details

Exception RedisSentinelException Source # |
Instance details Defined in Database.Redis.Sentinel Methods toException :: RedisSentinelException -> SomeException Source # fromException :: SomeException -> Maybe RedisSentinelException Source # displayException :: RedisSentinelException -> String Source #
Show RedisSentinelException Source # |
Instance details Defined in Database.Redis.Sentinel Methods showsPrec :: Int -> RedisSentinelException -> ShowS Source # show :: RedisSentinelException -> String Source # showList :: [RedisSentinelException] -> ShowS Source #

# Re-export Database.Redis

data Message Source #

Constructors

Message |

Fields

- msgChannel, msgMessage :: ByteString

PMessage |

Fields

- msgPattern, msgChannel, msgMessage :: ByteString

#### Instances

Instances details

Show Message Source # |
Instance details Defined in Database.Redis.PubSub Methods showsPrec :: Int -> Message -> ShowS Source # show :: Message -> String Source # showList :: [Message] -> ShowS Source #

data Reply Source #

Low-level representation of replies from the Redis server.

Constructors

SingleLine ByteString |
Error ByteString |
Integer Integer |
Bulk (Maybe ByteString) |
MultiBulk (Maybe [Reply]) |

#### Instances

Instances details

Generic Reply Source # |
Instance details Defined in Database.Redis.Protocol Associated Types type Rep Reply :: Type -> Type Source # Methods from :: Reply -> Rep Reply x Source # to :: Rep Reply x -> Reply Source #
Show Reply Source # |
Instance details Defined in Database.Redis.Protocol Methods showsPrec :: Int -> Reply -> ShowS Source # show :: Reply -> String Source # showList :: [Reply] -> ShowS Source #
NFData Reply Source # |
Instance details Defined in Database.Redis.Protocol Methods rnf :: Reply -> () Source #
Eq Reply Source # |
Instance details Defined in Database.Redis.Protocol Methods (==) :: Reply -> Reply -> Bool Source # (/=) :: Reply -> Reply -> Bool Source #
RedisResult Reply Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply Reply Source #
RedisCtx Redis (Either Reply) Source # |
Instance details Defined in Database.Redis.Core Methods returnDecode :: RedisResult a => Reply -> Redis (Either Reply a) Source #
type Rep Reply Source # |

Instance details

Defined in Database.Redis.Protocol

type Rep Reply = D1 ('MetaData "Reply" "Database.Redis.Protocol" "hedis-0.15.2-JYaiCM1PrHA3OOqRnak5zE" 'False) ((C1 ('MetaCons "SingleLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons "Error" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) :+: (C1 ('MetaCons "Integer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :+: (C1 ('MetaCons "Bulk" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ByteString))) :+: C1 ('MetaCons "MultiBulk" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Reply]))))))

data Redis a Source #

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.

#### Instances

Instances details

MonadFail Redis Source # |
Instance details Defined in Database.Redis.Core.Internal Methods fail :: String -> Redis a Source #
MonadIO Redis Source # |
Instance details Defined in Database.Redis.Core.Internal Methods liftIO :: IO a -> Redis a Source #
Applicative Redis Source # |
Instance details Defined in Database.Redis.Core.Internal Methods pure :: a -> Redis a Source # (<*>) :: Redis (a -> b) -> Redis a -> Redis b Source # liftA2 :: (a -> b -> c) -> Redis a -> Redis b -> Redis c Source # (*>) :: Redis a -> Redis b -> Redis b Source # (<*) :: Redis a -> Redis b -> Redis a Source #
Functor Redis Source # |
Instance details Defined in Database.Redis.Core.Internal Methods fmap :: (a -> b) -> Redis a -> Redis b Source # (<$) :: a -> Redis b -> Redis a Source #
Monad Redis Source # |
Instance details Defined in Database.Redis.Core.Internal Methods (>>=) :: Redis a -> (a -> Redis b) -> Redis b Source # (>>) :: Redis a -> Redis b -> Redis b Source # return :: a -> Redis a Source #
MonadRedis Redis Source # |
Instance details Defined in Database.Redis.Core Methods liftRedis :: Redis a -> Redis a Source #
MonadUnliftIO Redis Source # |
Instance details Defined in Database.Redis.Core.Internal Methods withRunInIO :: ((forall a. Redis a -> IO a) -> IO b) -> Redis b Source #
RedisCtx Redis (Either Reply) Source # |
Instance details Defined in Database.Redis.Core Methods returnDecode :: RedisResult a => Reply -> Redis (Either Reply a) Source #

class MonadRedis m => RedisCtx m f | m -> f where Source #

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

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

Methods

returnDecode :: RedisResult a => Reply -> m (f a) Source #

#### Instances

Instances details

RedisCtx RedisTx Queued Source # |
Instance details Defined in Database.Redis.Transactions Methods returnDecode :: RedisResult a => Reply -> RedisTx (Queued a) Source #
RedisCtx Redis (Either Reply) Source # |
Instance details Defined in Database.Redis.Core Methods returnDecode :: RedisResult a => Reply -> Redis (Either Reply a) Source #

class Monad m => MonadRedis m where Source #

Methods

liftRedis :: Redis a -> m a Source #

#### Instances

Instances details

MonadRedis Redis Source # |
Instance details Defined in Database.Redis.Core Methods liftRedis :: Redis a -> Redis a Source #
MonadRedis RedisTx Source # |
Instance details Defined in Database.Redis.Transactions Methods liftRedis :: Redis a -> RedisTx a Source #

data ConnectError Source #

Constructors

ConnectAuthError Reply |
ConnectSelectError Reply |

#### Instances

Instances details

Exception ConnectError Source # |
Instance details Defined in Database.Redis.Connection Methods toException :: ConnectError -> SomeException Source # fromException :: SomeException -> Maybe ConnectError Source # displayException :: ConnectError -> String Source #
Show ConnectError Source # |
Instance details Defined in Database.Redis.Connection Methods showsPrec :: Int -> ConnectError -> ShowS Source # show :: ConnectError -> String Source # showList :: [ConnectError] -> ShowS Source #
Eq ConnectError Source # |
Instance details Defined in Database.Redis.Connection Methods (==) :: ConnectError -> ConnectError -> Bool Source # (/=) :: ConnectError -> ConnectError -> Bool Source #

data ConnectInfo Source #

Information for connnecting to a Redis server.

It is recommended to not use the `ConnInfo` data constructor directly. Instead use `defaultConnectInfo` and update it with record syntax. For example to connect to a password protected Redis server running on localhost and listening to the default port:

    myConnectInfo :: ConnectInfo
    myConnectInfo = defaultConnectInfo {connectAuth = Just "secret"}

Constructors

ConnInfo |

Fields

- connectHost :: HostName

  Ignored when `connectPort` is a `UnixSocket`

- connectPort :: PortID
- connectAuth :: Maybe ByteString

  When the server is protected by a password, set `connectAuth` to `Just` the password. Each connection will then authenticate by the `auth` command.

- connectDatabase :: Integer

  Each connection will `select` the database with the given index.

- connectMaxConnections :: Int

  Maximum number of connections to keep open. The smallest acceptable value is 1.

- connectMaxIdleTime :: NominalDiffTime

  Amount of time for which an unused connection is kept open. The smallest acceptable value is 0.5 seconds. If the `timeout` value in your redis.conf file is non-zero, it should be larger than `connectMaxIdleTime`.

- connectTimeout :: Maybe NominalDiffTime

  Optional timeout until connection to Redis gets established. `ConnectTimeoutException` gets thrown if no socket get connected in this interval of time.

- connectTLSParams :: Maybe ClientParams

  Optional TLS parameters. TLS will be enabled if this is provided.

#### Instances

Instances details

Show ConnectInfo Source # |
Instance details Defined in Database.Redis.Connection Methods showsPrec :: Int -> ConnectInfo -> ShowS Source # show :: ConnectInfo -> String Source # showList :: [ConnectInfo] -> ShowS Source #

data PortID Source #

Constructors

PortNumber PortNumber |
UnixSocket String |

#### Instances

Instances details

Show PortID Source # |
Instance details Defined in Database.Redis.ConnectionContext Methods showsPrec :: Int -> PortID -> ShowS Source # show :: PortID -> String Source # showList :: [PortID] -> ShowS Source #
Eq PortID Source # |
Instance details Defined in Database.Redis.ConnectionContext Methods (==) :: PortID -> PortID -> Bool Source # (/=) :: PortID -> PortID -> Bool Source #

data PubSub Source #

Encapsulates subscription changes. Use `subscribe`, `unsubscribe`, `psubscribe`, `punsubscribe` or `mempty` to construct a value. Combine values by using the `Monoid` interface, i.e. `mappend` and `mconcat`.

#### Instances

Instances details

Monoid PubSub Source # |
Instance details Defined in Database.Redis.PubSub Methods mempty :: PubSub Source # mappend :: PubSub -> PubSub -> PubSub Source # mconcat :: [PubSub] -> PubSub Source #
Semigroup PubSub Source # |
Instance details Defined in Database.Redis.PubSub Methods (<>) :: PubSub -> PubSub -> PubSub Source # sconcat :: NonEmpty PubSub -> PubSub Source # stimes :: Integral b => b -> PubSub -> PubSub Source #
Eq PubSub Source # |
Instance details Defined in Database.Redis.PubSub Methods (==) :: PubSub -> PubSub -> Bool Source # (/=) :: PubSub -> PubSub -> Bool Source #

data Status Source #

Constructors

Ok |
Pong |
Status ByteString |

#### Instances

Instances details

Generic Status Source # |
Instance details Defined in Database.Redis.Types Associated Types type Rep Status :: Type -> Type Source # Methods from :: Status -> Rep Status x Source # to :: Rep Status x -> Status Source #
Show Status Source # |
Instance details Defined in Database.Redis.Types Methods showsPrec :: Int -> Status -> ShowS Source # show :: Status -> String Source # showList :: [Status] -> ShowS Source #
NFData Status Source # |
Instance details Defined in Database.Redis.Types Methods rnf :: Status -> () Source #
Eq Status Source # |
Instance details Defined in Database.Redis.Types Methods (==) :: Status -> Status -> Bool Source # (/=) :: Status -> Status -> Bool Source #
RedisResult Status Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply Status Source #
type Rep Status Source # |

Instance details

Defined in Database.Redis.Types

type Rep Status = D1 ('MetaData "Status" "Database.Redis.Types" "hedis-0.15.2-JYaiCM1PrHA3OOqRnak5zE" 'False) (C1 ('MetaCons "Ok" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Pong" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Status" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))

class RedisResult a where Source #

Methods

decode :: Reply -> Either Reply a Source #

#### Instances

Instances details

RedisResult ByteString Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply ByteString Source #
RedisResult ClusterNodesResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterNodesResponse Source #
RedisResult ClusterSlotsNode Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterSlotsNode Source #
RedisResult ClusterSlotsResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterSlotsResponse Source #
RedisResult ClusterSlotsResponseEntry Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterSlotsResponseEntry Source #
RedisResult Cursor Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply Cursor Source #
RedisResult Slowlog Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply Slowlog Source #
RedisResult StreamsRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply StreamsRecord Source #
RedisResult XInfoConsumersResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XInfoConsumersResponse Source #
RedisResult XInfoGroupsResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XInfoGroupsResponse Source #
RedisResult XInfoStreamResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XInfoStreamResponse Source #
RedisResult XPendingDetailRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XPendingDetailRecord Source #
RedisResult XPendingSummaryResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XPendingSummaryResponse Source #
RedisResult XReadResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XReadResponse Source #
RedisResult Reply Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply Reply Source #
RedisResult RedisType Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply RedisType Source #
RedisResult Status Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply Status Source #
RedisResult Integer Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply Integer Source #
RedisResult Bool Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply Bool Source #
RedisResult Double Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply Double Source #
RedisResult a => RedisResult (Maybe a) Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply (Maybe a) Source #
(RedisResult k, RedisResult v) => RedisResult [(k, v)] Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply [(k, v)] Source #
RedisResult a => RedisResult [a] Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply [a] Source #
(RedisResult a, RedisResult b) => RedisResult (a, b) Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply (a, b) Source #

data ConnectionLostException Source #

Constructors

ConnectionLost |

#### Instances

Instances details

Exception ConnectionLostException Source # |
Instance details Defined in Database.Redis.ConnectionContext Methods toException :: ConnectionLostException -> SomeException Source # fromException :: SomeException -> Maybe ConnectionLostException Source # displayException :: ConnectionLostException -> String Source #
Show ConnectionLostException Source # |
Instance details Defined in Database.Redis.ConnectionContext Methods showsPrec :: Int -> ConnectionLostException -> ShowS Source # show :: ConnectionLostException -> String Source # showList :: [ConnectionLostException] -> ShowS Source #

newtype ConnectTimeout Source #

Constructors

ConnectTimeout ConnectPhase |

#### Instances

Instances details

Exception ConnectTimeout Source # |
Instance details Defined in Database.Redis.ConnectionContext Methods toException :: ConnectTimeout -> SomeException Source # fromException :: SomeException -> Maybe ConnectTimeout Source # displayException :: ConnectTimeout -> String Source #
Show ConnectTimeout Source # |
Instance details Defined in Database.Redis.ConnectionContext Methods showsPrec :: Int -> ConnectTimeout -> ShowS Source # show :: ConnectTimeout -> String Source # showList :: [ConnectTimeout] -> ShowS Source #

data HashSlot Source #

#### Instances

Instances details

Enum HashSlot Source # |

Instance details

Defined in Database.Redis.Cluster.HashSlot

Methods

succ :: HashSlot -> HashSlot Source #

pred :: HashSlot -> HashSlot Source #

toEnum :: Int -> HashSlot Source #

fromEnum :: HashSlot -> Int Source #

enumFrom :: HashSlot -> [HashSlot] Source #

enumFromThen :: HashSlot -> HashSlot -> [HashSlot] Source #

enumFromTo :: HashSlot -> HashSlot -> [HashSlot] Source #

enumFromThenTo :: HashSlot -> HashSlot -> HashSlot -> [HashSlot] Source #

Num HashSlot Source # |
Instance details Defined in Database.Redis.Cluster.HashSlot Methods (+) :: HashSlot -> HashSlot -> HashSlot Source # (-) :: HashSlot -> HashSlot -> HashSlot Source # (*) :: HashSlot -> HashSlot -> HashSlot Source # negate :: HashSlot -> HashSlot Source # abs :: HashSlot -> HashSlot Source # signum :: HashSlot -> HashSlot Source # fromInteger :: Integer -> HashSlot Source #
Integral HashSlot Source # |

Instance details

Defined in Database.Redis.Cluster.HashSlot

Methods

quot :: HashSlot -> HashSlot -> HashSlot Source #

rem :: HashSlot -> HashSlot -> HashSlot Source #

div :: HashSlot -> HashSlot -> HashSlot Source #

mod :: HashSlot -> HashSlot -> HashSlot Source #

quotRem :: HashSlot -> HashSlot -> (HashSlot, HashSlot) Source #

divMod :: HashSlot -> HashSlot -> (HashSlot, HashSlot) Source #

toInteger :: HashSlot -> Integer Source #

Real HashSlot Source # |
Instance details Defined in Database.Redis.Cluster.HashSlot Methods toRational :: HashSlot -> Rational Source #
Show HashSlot Source # |
Instance details Defined in Database.Redis.Cluster.HashSlot Methods showsPrec :: Int -> HashSlot -> ShowS Source # show :: HashSlot -> String Source # showList :: [HashSlot] -> ShowS Source #
Eq HashSlot Source # |
Instance details Defined in Database.Redis.Cluster.HashSlot Methods (==) :: HashSlot -> HashSlot -> Bool Source # (/=) :: HashSlot -> HashSlot -> Bool Source #
Ord HashSlot Source # |
Instance details Defined in Database.Redis.Cluster.HashSlot Methods compare :: HashSlot -> HashSlot -> Ordering Source # (<) :: HashSlot -> HashSlot -> Bool Source # (<=) :: HashSlot -> HashSlot -> Bool Source # (>) :: HashSlot -> HashSlot -> Bool Source # (>=) :: HashSlot -> HashSlot -> Bool Source # max :: HashSlot -> HashSlot -> HashSlot Source # min :: HashSlot -> HashSlot -> HashSlot Source #

data ClusterSlotsResponse Source #

Constructors

ClusterSlotsResponse |

Fields

- clusterSlotsResponseEntries :: [ClusterSlotsResponseEntry]

#### Instances

Instances details

Show ClusterSlotsResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ClusterSlotsResponse -> ShowS Source # show :: ClusterSlotsResponse -> String Source # showList :: [ClusterSlotsResponse] -> ShowS Source #
RedisResult ClusterSlotsResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterSlotsResponse Source #

data ClusterSlotsResponseEntry Source #

Constructors

ClusterSlotsResponseEntry |

Fields

- clusterSlotsResponseEntryStartSlot :: Int
- clusterSlotsResponseEntryEndSlot :: Int
- clusterSlotsResponseEntryMaster :: ClusterSlotsNode
- clusterSlotsResponseEntryReplicas :: [ClusterSlotsNode]

#### Instances

Instances details

Show ClusterSlotsResponseEntry Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ClusterSlotsResponseEntry -> ShowS Source # show :: ClusterSlotsResponseEntry -> String Source # showList :: [ClusterSlotsResponseEntry] -> ShowS Source #
RedisResult ClusterSlotsResponseEntry Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterSlotsResponseEntry Source #

data ClusterSlotsNode Source #

Constructors

ClusterSlotsNode |

Fields

- clusterSlotsNodeIP :: ByteString
- clusterSlotsNodePort :: Int
- clusterSlotsNodeID :: ByteString

#### Instances

Instances details

Show ClusterSlotsNode Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ClusterSlotsNode -> ShowS Source # show :: ClusterSlotsNode -> String Source # showList :: [ClusterSlotsNode] -> ShowS Source #
RedisResult ClusterSlotsNode Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterSlotsNode Source #

type RedisChannel = ByteString Source #

A Redis channel name

type RedisPChannel = ByteString Source #

A Redis pattern channel name

type MessageCallback = ByteString -> IO () Source #

A handler for a message from a subscribed channel. The callback is passed the message content.

Messages are processed synchronously in the receiving thread, so if the callback takes a long time it will block other callbacks and other messages from being received. If you need to move long-running work to a different thread, we suggest you use `TBQueue` with a reasonable bound, so that if messages are arriving faster than you can process them, you do eventually block.

If the callback throws an exception, the exception will be thrown from `pubSubForever` which will cause the entire Redis connection for all subscriptions to be closed. As long as you call `pubSubForever` in a loop you will reconnect to your subscribed channels, but you should probably add an exception handler to each callback to prevent this.

type PMessageCallback = RedisChannel -> ByteString -> IO () Source #

A handler for a message from a psubscribed channel. The callback is passed the channel the message was sent on plus the message content.

Similar to `MessageCallback`, callbacks are executed synchronously and any exceptions are rethrown from `pubSubForever`.

data PubSubController Source #

A controller that stores a set of channels, pattern channels, and callbacks. It allows you to manage Pub/Sub subscriptions and pattern subscriptions and alter them at any time throughout the life of your program. You should typically create the controller at the start of your program and then store it through the life of your program, using `addChannels` and `removeChannels` to update the current subscriptions.

type UnregisterCallbacksAction = IO () Source #

An action that when executed will unregister the callbacks. It is returned from `addChannels` or `addChannelsAndWait` and typically you would use it in `bracket` to guarantee that you unsubscribe from channels. For example, if you are using websockets to distribute messages to clients, you could use something such as:

    websocketConn <- Network.WebSockets.acceptRequest pending
    let mycallback msg = Network.WebSockets.sendTextData websocketConn msg
    bracket (addChannelsAndWait ctrl [("hello", mycallback)] []) id $ const $ do
      {- loop here calling Network.WebSockets.receiveData -}

data Queued a Source #

A `Queued` value represents the result of a command inside a transaction. It is a proxy object for the actual result, which will only be available after returning from a `multiExec` transaction.

`Queued` values are composable by utilizing the `Functor`, `Applicative` or `Monad` interfaces.

#### Instances

Instances details

Applicative Queued Source # |
Instance details Defined in Database.Redis.Transactions Methods pure :: a -> Queued a Source # (<*>) :: Queued (a -> b) -> Queued a -> Queued b Source # liftA2 :: (a -> b -> c) -> Queued a -> Queued b -> Queued c Source # (*>) :: Queued a -> Queued b -> Queued b Source # (<*) :: Queued a -> Queued b -> Queued a Source #
Functor Queued Source # |
Instance details Defined in Database.Redis.Transactions Methods fmap :: (a -> b) -> Queued a -> Queued b Source # (<$) :: a -> Queued b -> Queued a Source #
Monad Queued Source # |
Instance details Defined in Database.Redis.Transactions Methods (>>=) :: Queued a -> (a -> Queued b) -> Queued b Source # (>>) :: Queued a -> Queued b -> Queued b Source # return :: a -> Queued a Source #
RedisCtx RedisTx Queued Source # |
Instance details Defined in Database.Redis.Transactions Methods returnDecode :: RedisResult a => Reply -> RedisTx (Queued a) Source #

data TxResult a Source #

Result of a `multiExec` transaction.

Constructors

TxSuccess a | Transaction completed successfully. The wrapped value corresponds to the `Queued` value returned from the `multiExec` argument action.
TxAborted | Transaction aborted due to an earlier `watch` command.
TxError String | At least one of the commands returned an `Error` reply.

#### Instances

Instances details

Generic (TxResult a) Source # |
Instance details Defined in Database.Redis.Transactions Associated Types type Rep (TxResult a) :: Type -> Type Source # Methods from :: TxResult a -> Rep (TxResult a) x Source # to :: Rep (TxResult a) x -> TxResult a Source #
Show a => Show (TxResult a) Source # |
Instance details Defined in Database.Redis.Transactions Methods showsPrec :: Int -> TxResult a -> ShowS Source # show :: TxResult a -> String Source # showList :: [TxResult a] -> ShowS Source #
NFData a => NFData (TxResult a) Source # |
Instance details Defined in Database.Redis.Transactions Methods rnf :: TxResult a -> () Source #
Eq a => Eq (TxResult a) Source # |
Instance details Defined in Database.Redis.Transactions Methods (==) :: TxResult a -> TxResult a -> Bool Source # (/=) :: TxResult a -> TxResult a -> Bool Source #
type Rep (TxResult a) Source # |

Instance details

Defined in Database.Redis.Transactions

type Rep (TxResult a) = D1 ('MetaData "TxResult" "Database.Redis.Transactions" "hedis-0.15.2-JYaiCM1PrHA3OOqRnak5zE" 'False) (C1 ('MetaCons "TxSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "TxAborted" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TxError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

data RedisTx a Source #

Command-context inside of MULTI/EXEC transactions. Use `multiExec` to run actions of this type.

In the `RedisTx` context, all commands return a `Queued` value. It is a proxy object for the actual result, which will only be available after finishing the transaction.

#### Instances

Instances details

MonadIO RedisTx Source # |
Instance details Defined in Database.Redis.Transactions Methods liftIO :: IO a -> RedisTx a Source #
Applicative RedisTx Source # |
Instance details Defined in Database.Redis.Transactions Methods pure :: a -> RedisTx a Source # (<*>) :: RedisTx (a -> b) -> RedisTx a -> RedisTx b Source # liftA2 :: (a -> b -> c) -> RedisTx a -> RedisTx b -> RedisTx c Source # (*>) :: RedisTx a -> RedisTx b -> RedisTx b Source # (<*) :: RedisTx a -> RedisTx b -> RedisTx a Source #
Functor RedisTx Source # |
Instance details Defined in Database.Redis.Transactions Methods fmap :: (a -> b) -> RedisTx a -> RedisTx b Source # (<$) :: a -> RedisTx b -> RedisTx a Source #
Monad RedisTx Source # |
Instance details Defined in Database.Redis.Transactions Methods (>>=) :: RedisTx a -> (a -> RedisTx b) -> RedisTx b Source # (>>) :: RedisTx a -> RedisTx b -> RedisTx b Source # return :: a -> RedisTx a Source #
MonadRedis RedisTx Source # |
Instance details Defined in Database.Redis.Transactions Methods liftRedis :: Redis a -> RedisTx a Source #
RedisCtx RedisTx Queued Source # |
Instance details Defined in Database.Redis.Transactions Methods returnDecode :: RedisResult a => Reply -> RedisTx (Queued a) Source #

data MigrateOpts Source #

Options for the `migrate` command.

Constructors

MigrateOpts |

Fields

- migrateCopy :: Bool
- migrateReplace :: Bool

#### Instances

Instances details

Show MigrateOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> MigrateOpts -> ShowS Source # show :: MigrateOpts -> String Source # showList :: [MigrateOpts] -> ShowS Source #
Eq MigrateOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: MigrateOpts -> MigrateOpts -> Bool Source # (/=) :: MigrateOpts -> MigrateOpts -> Bool Source #

data Cursor Source #

#### Instances

Instances details

Show Cursor Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> Cursor -> ShowS Source # show :: Cursor -> String Source # showList :: [Cursor] -> ShowS Source #
Eq Cursor Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: Cursor -> Cursor -> Bool Source # (/=) :: Cursor -> Cursor -> Bool Source #
RedisResult Cursor Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply Cursor Source #

data ScanOpts Source #

Constructors

ScanOpts |

Fields

- scanMatch :: Maybe ByteString
- scanCount :: Maybe Integer

#### Instances

Instances details

Show ScanOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ScanOpts -> ShowS Source # show :: ScanOpts -> String Source # showList :: [ScanOpts] -> ShowS Source #
Eq ScanOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: ScanOpts -> ScanOpts -> Bool Source # (/=) :: ScanOpts -> ScanOpts -> Bool Source #

data SortOpts Source #

Options for the `sort` command.

Constructors

SortOpts |

Fields

- sortBy :: Maybe ByteString
- sortLimit :: (Integer, Integer)
- sortGet :: [ByteString]
- sortOrder :: SortOrder
- sortAlpha :: Bool

#### Instances

Instances details

Show SortOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> SortOpts -> ShowS Source # show :: SortOpts -> String Source # showList :: [SortOpts] -> ShowS Source #
Eq SortOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: SortOpts -> SortOpts -> Bool Source # (/=) :: SortOpts -> SortOpts -> Bool Source #

data SortOrder Source #

Constructors

Asc |
Desc |

#### Instances

Instances details

Show SortOrder Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> SortOrder -> ShowS Source # show :: SortOrder -> String Source # showList :: [SortOrder] -> ShowS Source #
Eq SortOrder Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: SortOrder -> SortOrder -> Bool Source # (/=) :: SortOrder -> SortOrder -> Bool Source #

data RedisType Source #

Constructors

None |
String |
Hash |
List |
Set |
ZSet |

#### Instances

Instances details

Show RedisType Source # |
Instance details Defined in Database.Redis.Types Methods showsPrec :: Int -> RedisType -> ShowS Source # show :: RedisType -> String Source # showList :: [RedisType] -> ShowS Source #
Eq RedisType Source # |
Instance details Defined in Database.Redis.Types Methods (==) :: RedisType -> RedisType -> Bool Source # (/=) :: RedisType -> RedisType -> Bool Source #
RedisResult RedisType Source # |
Instance details Defined in Database.Redis.Types Methods decode :: Reply -> Either Reply RedisType Source #

data DebugMode Source #

#### Instances

Instances details

Show DebugMode Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> DebugMode -> ShowS Source # show :: DebugMode -> String Source # showList :: [DebugMode] -> ShowS Source #
Eq DebugMode Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: DebugMode -> DebugMode -> Bool Source # (/=) :: DebugMode -> DebugMode -> Bool Source #

data ReplyMode Source #

#### Instances

Instances details

Show ReplyMode Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ReplyMode -> ShowS Source # show :: ReplyMode -> String Source # showList :: [ReplyMode] -> ShowS Source #
Eq ReplyMode Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: ReplyMode -> ReplyMode -> Bool Source # (/=) :: ReplyMode -> ReplyMode -> Bool Source #

data Slowlog Source #

A single entry from the slowlog.

Constructors

Slowlog |

Fields

- slowlogId :: Integer

  A unique progressive identifier for every slow log entry.

- slowlogTimestamp :: Integer

  The unix timestamp at which the logged command was processed.

- slowlogMicros :: Integer

  The amount of time needed for its execution, in microseconds.

- slowlogCmd :: [ByteString]

  The command and it's arguments.

- slowlogClientIpAndPort :: Maybe ByteString
- slowlogClientName :: Maybe ByteString

#### Instances

Instances details

Show Slowlog Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> Slowlog -> ShowS Source # show :: Slowlog -> String Source # showList :: [Slowlog] -> ShowS Source #
Eq Slowlog Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: Slowlog -> Slowlog -> Bool Source # (/=) :: Slowlog -> Slowlog -> Bool Source #
RedisResult Slowlog Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply Slowlog Source #

data ZaddOpts Source #

Constructors

ZaddOpts |

Fields

- zaddCondition :: Maybe Condition
- zaddChange :: Bool
- zaddIncrement :: Bool

#### Instances

Instances details

Show ZaddOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ZaddOpts -> ShowS Source # show :: ZaddOpts -> String Source # showList :: [ZaddOpts] -> ShowS Source #
Eq ZaddOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: ZaddOpts -> ZaddOpts -> Bool Source # (/=) :: ZaddOpts -> ZaddOpts -> Bool Source #

data Aggregate Source #

Constructors

Sum |
Min |
Max |

#### Instances

Instances details

Show Aggregate Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> Aggregate -> ShowS Source # show :: Aggregate -> String Source # showList :: [Aggregate] -> ShowS Source #
Eq Aggregate Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: Aggregate -> Aggregate -> Bool Source # (/=) :: Aggregate -> Aggregate -> Bool Source #

data RangeLex a Source #

Constructors

Incl a |
Excl a |
Minr |
Maxr |

data Condition Source #

Constructors

Nx |
Xx |

#### Instances

Instances details

Show Condition Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> Condition -> ShowS Source # show :: Condition -> String Source # showList :: [Condition] -> ShowS Source #
Eq Condition Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: Condition -> Condition -> Bool Source # (/=) :: Condition -> Condition -> Bool Source #

data SetOpts Source #

Constructors

SetOpts |

Fields

- setSeconds :: Maybe Integer
- setMilliseconds :: Maybe Integer
- setCondition :: Maybe Condition

#### Instances

Instances details

Show SetOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> SetOpts -> ShowS Source # show :: SetOpts -> String Source # showList :: [SetOpts] -> ShowS Source #
Eq SetOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: SetOpts -> SetOpts -> Bool Source # (/=) :: SetOpts -> SetOpts -> Bool Source #

data XReadOpts Source #

Constructors

XReadOpts |

Fields

- block :: Maybe Integer
- recordCount :: Maybe Integer

#### Instances

Instances details

Show XReadOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XReadOpts -> ShowS Source # show :: XReadOpts -> String Source # showList :: [XReadOpts] -> ShowS Source #
Eq XReadOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XReadOpts -> XReadOpts -> Bool Source # (/=) :: XReadOpts -> XReadOpts -> Bool Source #

data XReadResponse Source #

Constructors

XReadResponse |

Fields

- stream :: ByteString
- records :: [StreamsRecord]

#### Instances

Instances details

Show XReadResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XReadResponse -> ShowS Source # show :: XReadResponse -> String Source # showList :: [XReadResponse] -> ShowS Source #
Eq XReadResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XReadResponse -> XReadResponse -> Bool Source # (/=) :: XReadResponse -> XReadResponse -> Bool Source #
RedisResult XReadResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XReadResponse Source #

data StreamsRecord Source #

Constructors

StreamsRecord |

Fields

- recordId :: ByteString
- keyValues :: [(ByteString, ByteString)]

#### Instances

Instances details

Show StreamsRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> StreamsRecord -> ShowS Source # show :: StreamsRecord -> String Source # showList :: [StreamsRecord] -> ShowS Source #
Eq StreamsRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: StreamsRecord -> StreamsRecord -> Bool Source # (/=) :: StreamsRecord -> StreamsRecord -> Bool Source #
RedisResult StreamsRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply StreamsRecord Source #

data TrimOpts Source #

Constructors

NoArgs |
Maxlen Integer |
ApproxMaxlen Integer |

data XPendingSummaryResponse Source #

Constructors

XPendingSummaryResponse |

Fields

- numPendingMessages :: Integer
- smallestPendingMessageId :: ByteString
- largestPendingMessageId :: ByteString
- numPendingMessagesByconsumer :: [(ByteString, Integer)]

#### Instances

Instances details

Show XPendingSummaryResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XPendingSummaryResponse -> ShowS Source # show :: XPendingSummaryResponse -> String Source # showList :: [XPendingSummaryResponse] -> ShowS Source #
Eq XPendingSummaryResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XPendingSummaryResponse -> XPendingSummaryResponse -> Bool Source # (/=) :: XPendingSummaryResponse -> XPendingSummaryResponse -> Bool Source #
RedisResult XPendingSummaryResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XPendingSummaryResponse Source #

data XPendingDetailRecord Source #

Constructors

XPendingDetailRecord |

Fields

- messageId :: ByteString
- consumer :: ByteString
- millisSinceLastDelivered :: Integer
- numTimesDelivered :: Integer

#### Instances

Instances details

Show XPendingDetailRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XPendingDetailRecord -> ShowS Source # show :: XPendingDetailRecord -> String Source # showList :: [XPendingDetailRecord] -> ShowS Source #
Eq XPendingDetailRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XPendingDetailRecord -> XPendingDetailRecord -> Bool Source # (/=) :: XPendingDetailRecord -> XPendingDetailRecord -> Bool Source #
RedisResult XPendingDetailRecord Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XPendingDetailRecord Source #

data XClaimOpts Source #

Constructors

XClaimOpts |

Fields

- xclaimIdle :: Maybe Integer
- xclaimTime :: Maybe Integer
- xclaimRetryCount :: Maybe Integer
- xclaimForce :: Bool

#### Instances

Instances details

Show XClaimOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XClaimOpts -> ShowS Source # show :: XClaimOpts -> String Source # showList :: [XClaimOpts] -> ShowS Source #
Eq XClaimOpts Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XClaimOpts -> XClaimOpts -> Bool Source # (/=) :: XClaimOpts -> XClaimOpts -> Bool Source #

data XInfoConsumersResponse Source #

Constructors

XInfoConsumersResponse |

Fields

- xinfoConsumerName :: ByteString
- xinfoConsumerNumPendingMessages :: Integer
- xinfoConsumerIdleTime :: Integer

#### Instances

Instances details

Show XInfoConsumersResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XInfoConsumersResponse -> ShowS Source # show :: XInfoConsumersResponse -> String Source # showList :: [XInfoConsumersResponse] -> ShowS Source #
Eq XInfoConsumersResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XInfoConsumersResponse -> XInfoConsumersResponse -> Bool Source # (/=) :: XInfoConsumersResponse -> XInfoConsumersResponse -> Bool Source #
RedisResult XInfoConsumersResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XInfoConsumersResponse Source #

data XInfoGroupsResponse Source #

Constructors

XInfoGroupsResponse |

Fields

- xinfoGroupsGroupName :: ByteString
- xinfoGroupsNumConsumers :: Integer
- xinfoGroupsNumPendingMessages :: Integer
- xinfoGroupsLastDeliveredMessageId :: ByteString

#### Instances

Instances details

Show XInfoGroupsResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XInfoGroupsResponse -> ShowS Source # show :: XInfoGroupsResponse -> String Source # showList :: [XInfoGroupsResponse] -> ShowS Source #
Eq XInfoGroupsResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XInfoGroupsResponse -> XInfoGroupsResponse -> Bool Source # (/=) :: XInfoGroupsResponse -> XInfoGroupsResponse -> Bool Source #
RedisResult XInfoGroupsResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XInfoGroupsResponse Source #

data XInfoStreamResponse Source #

Constructors

XInfoStreamResponse |

Fields

- xinfoStreamLength :: Integer
- xinfoStreamRadixTreeKeys :: Integer
- xinfoStreamRadixTreeNodes :: Integer
- xinfoStreamNumGroups :: Integer
- xinfoStreamLastEntryId :: ByteString
- xinfoStreamFirstEntry :: StreamsRecord
- xinfoStreamLastEntry :: StreamsRecord

XInfoStreamEmptyResponse |

Fields

- xinfoStreamLength :: Integer
- xinfoStreamRadixTreeKeys :: Integer
- xinfoStreamRadixTreeNodes :: Integer
- xinfoStreamNumGroups :: Integer
- xinfoStreamLastEntryId :: ByteString

#### Instances

Instances details

Show XInfoStreamResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> XInfoStreamResponse -> ShowS Source # show :: XInfoStreamResponse -> String Source # showList :: [XInfoStreamResponse] -> ShowS Source #
Eq XInfoStreamResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: XInfoStreamResponse -> XInfoStreamResponse -> Bool Source # (/=) :: XInfoStreamResponse -> XInfoStreamResponse -> Bool Source #
RedisResult XInfoStreamResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply XInfoStreamResponse Source #

data ClusterNodesResponse Source #

Constructors

ClusterNodesResponse |

Fields

- clusterNodesResponseEntries :: [ClusterNodesResponseEntry]

#### Instances

Instances details

Show ClusterNodesResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ClusterNodesResponse -> ShowS Source # show :: ClusterNodesResponse -> String Source # showList :: [ClusterNodesResponse] -> ShowS Source #
Eq ClusterNodesResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: ClusterNodesResponse -> ClusterNodesResponse -> Bool Source # (/=) :: ClusterNodesResponse -> ClusterNodesResponse -> Bool Source #
RedisResult ClusterNodesResponse Source # |
Instance details Defined in Database.Redis.ManualCommands Methods decode :: Reply -> Either Reply ClusterNodesResponse Source #

data ClusterNodesResponseEntry Source #

Constructors

ClusterNodesResponseEntry |

Fields

- clusterNodesResponseNodeId :: ByteString
- clusterNodesResponseNodeIp :: ByteString
- clusterNodesResponseNodePort :: Integer
- clusterNodesResponseNodeFlags :: [ByteString]
- clusterNodesResponseMasterId :: Maybe ByteString
- clusterNodesResponsePingSent :: Integer
- clusterNodesResponsePongReceived :: Integer
- clusterNodesResponseConfigEpoch :: Integer
- clusterNodesResponseLinkState :: ByteString
- clusterNodesResponseSlots :: [ClusterNodesResponseSlotSpec]

#### Instances

Instances details

Show ClusterNodesResponseEntry Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ClusterNodesResponseEntry -> ShowS Source # show :: ClusterNodesResponseEntry -> String Source # showList :: [ClusterNodesResponseEntry] -> ShowS Source #
Eq ClusterNodesResponseEntry Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: ClusterNodesResponseEntry -> ClusterNodesResponseEntry -> Bool Source # (/=) :: ClusterNodesResponseEntry -> ClusterNodesResponseEntry -> Bool Source #

data ClusterNodesResponseSlotSpec Source #

Constructors

ClusterNodesResponseSingleSlot Integer |
ClusterNodesResponseSlotRange Integer Integer |
ClusterNodesResponseSlotImporting Integer ByteString |
ClusterNodesResponseSlotMigrating Integer ByteString |

#### Instances

Instances details

Show ClusterNodesResponseSlotSpec Source # |
Instance details Defined in Database.Redis.ManualCommands Methods showsPrec :: Int -> ClusterNodesResponseSlotSpec -> ShowS Source # show :: ClusterNodesResponseSlotSpec -> String Source # showList :: [ClusterNodesResponseSlotSpec] -> ShowS Source #
Eq ClusterNodesResponseSlotSpec Source # |
Instance details Defined in Database.Redis.ManualCommands Methods (==) :: ClusterNodesResponseSlotSpec -> ClusterNodesResponseSlotSpec -> Bool Source # (/=) :: ClusterNodesResponseSlotSpec -> ClusterNodesResponseSlotSpec -> Bool Source #

time :: RedisCtx m f => m (f (Integer, Integer)) Source #

wait Source #

Arguments

:: RedisCtx m f |
=> Integer | numslaves
-> Integer | timeout
-> m (f Integer) |

get Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f (Maybe ByteString)) |

sort Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> SortOpts |
-> m (f [ByteString]) |

migrate Source #

Arguments

:: RedisCtx m f |
=> ByteString | host
-> ByteString | port
-> ByteString | key
-> Integer | destinationDb
-> Integer | timeout
-> m (f Status) |

append Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | value
-> m (f Integer) |

bitcount Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

keys Source #

Arguments

:: RedisCtx m f |
=> ByteString | pattern
-> m (f [ByteString]) |

scan Source #

Arguments

:: RedisCtx m f |
=> Cursor |
-> m (f (Cursor, [ByteString])) | next cursor and values

select Source #

Arguments

:: RedisCtx m f |
=> Integer | index
-> m (f Status) |

rename Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | newkey
-> m (f Status) |

set Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | value
-> m (f Status) |

move Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | db
-> m (f Bool) |

unRedis :: Redis a -> ReaderT RedisEnv IO a Source #

Deconstruct Redis constructor.

`unRedis` and `reRedis` can be used to define instances for arbitrary typeclasses.

WARNING! These functions are considered internal and no guarantee is given at this point that they will not break in future.

reRedis :: ReaderT RedisEnv IO a -> Redis a Source #

Reconstruct Redis constructor.

checkedConnect :: ConnectInfo -> IO Connection Source #

Constructs a `Connection` pool to a Redis server designated by the given `ConnectInfo`, then tests if the server is actually there. Throws an exception if the connection to the Redis server can't be established.

disconnect :: Connection -> IO () Source #

Destroy all idle resources in the pool.

withConnect :: (MonadMask m, MonadIO m) => ConnectInfo -> (Connection -> m c) -> m c Source #

Memory bracket around `connect` and `disconnect`.

withCheckedConnect :: ConnectInfo -> (Connection -> IO c) -> IO c Source #

Memory bracket around `checkedConnect` and `disconnect`

defaultConnectInfo :: ConnectInfo Source #

Default information for connecting:

     connectHost           = "localhost"
     connectPort           = PortNumber 6379 -- Redis default port
     connectAuth           = Nothing         -- No password
     connectDatabase       = 0               -- SELECT database 0
     connectMaxConnections = 50              -- Up to 50 connections
     connectMaxIdleTime    = 30              -- Keep open for 30 seconds
     connectTimeout        = Nothing         -- Don't add timeout logic
     connectTLSParams      = Nothing         -- Do not use TLS

parseConnectInfo :: String -> Either String ConnectInfo Source #

Parse a ``ConnectInfo`` from a URL

Username is ignored, path is used to specify the database:

    >>> parseConnectInfo "redis://username:password@host:42/2"
    Right (ConnInfo {connectHost = "host", connectPort = PortNumber 42, connectAuth = Just "password", connectDatabase = 2, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})

    >>> parseConnectInfo "redis://username:password@host:42/db"
    Left "Invalid port: db"

The scheme is validated, to prevent mixing up configurations:

    >>> parseConnectInfo "postgres://"
    Left "Wrong scheme"

Beyond that, all values are optional. Omitted values are taken from ``defaultConnectInfo``:

    >>> parseConnectInfo "redis://"
    Right (ConnInfo {connectHost = "localhost", connectPort = PortNumber 6379, connectAuth = Nothing, connectDatabase = 0, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})

connectCluster :: ConnectInfo -> IO Connection Source #

Constructs a `ShardMap` of connections to clustered nodes. The argument is a `ConnectInfo` for any node in the cluster

Some Redis commands are currently not supported in cluster mode - CONFIG, AUTH - SCAN - MOVE, SELECT - PUBLISH, SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, PUNSUBSCRIBE, RESET

sendRequest :: (RedisCtx m f, RedisResult a) => [ByteString] -> m (f a) Source #

`sendRequest` can be used to implement commands from experimental versions of Redis. An example of how to implement a command is given below.

    -- |Redis DEBUG OBJECT command
    debugObject :: ByteString -> Redis (Either Reply ByteString)
    debugObject key = sendRequest ["DEBUG", "OBJECT", key]

keyToSlot :: ByteString -> HashSlot Source #

Compute the hashslot associated with a key

ping :: RedisCtx m f => m (f Status) Source #

auth Source #

Arguments

:: RedisCtx m f |
=> ByteString | password
-> m (f Status) |

clusterSlots :: RedisCtx m f => m (f ClusterSlotsResponse) Source #

command :: RedisCtx m f => m (f [CommandInfo]) Source #

publish Source #

Arguments

:: RedisCtx m f |
=> ByteString | channel
-> ByteString | message
-> m (f Integer) |

Post a message to a channel (http://redis.io/commands/publish).

pubSub Source #

Arguments

:: PubSub | Initial subscriptions.
-> (Message -> IO PubSub) | Callback function.
-> Redis () |

Listens to published messages on subscribed channels and channels matching the subscribed patterns. For documentation on the semantics of Redis Pub/Sub see http://redis.io/topics/pubsub.

The given callback function is called for each received message. Subscription changes are triggered by the returned `PubSub`. To keep subscriptions unchanged, the callback can return `mempty`.

Example: Subscribe to the "news" channel indefinitely.

     pubSub (subscribe ["news"]) $ \msg -> do
         putStrLn $ "Message from " ++ show (msgChannel msg)
         return mempty

Example: Receive a single message from the "chat" channel.

     pubSub (subscribe ["chat"]) $ \msg -> do
         putStrLn $ "Message from " ++ show (msgChannel msg)
         return $ unsubscribe ["chat"]

It should be noted that Redis Pub/Sub by its nature is asynchronous so returning `unsubscribe` does not mean that callback won't be able to receive any further messages. And to guarantee that you won't won't process messages after unsubscription and won't unsubscribe from the same channel more than once you need to use `IORef` or something similar

subscribe Source #

Arguments

:: [ByteString] | channel
-> PubSub |

Listen for messages published to the given channels (http://redis.io/commands/subscribe).

unsubscribe Source #

Arguments

:: [ByteString] | channel
-> PubSub |

Stop listening for messages posted to the given channels (http://redis.io/commands/unsubscribe).

psubscribe Source #

Arguments

:: [ByteString] | pattern
-> PubSub |

Listen for messages published to channels matching the given patterns (http://redis.io/commands/psubscribe).

punsubscribe Source #

Arguments

:: [ByteString] | pattern
-> PubSub |

Stop listening for messages posted to channels matching the given patterns (http://redis.io/commands/punsubscribe).

pubSubForever Source #

Arguments

:: Connection | The connection pool
-> PubSubController | The controller which keeps track of all subscriptions and handlers
-> IO () | This action is executed once Redis acknowledges that all the subscriptions in the controller are now subscribed. You can use this after an exception (such as `ConnectionLost`) to signal that all subscriptions are now reactivated.
-> IO () |

Open a connection to the Redis server, register to all channels in the `PubSubController`, and process messages and subscription change requests forever. The only way this will ever exit is if there is an exception from the network code or an unhandled exception in a `MessageCallback` or `PMessageCallback`. For example, if the network connection to Redis dies, `pubSubForever` will throw a `ConnectionLost`. When such an exception is thrown, you can recall `pubSubForever` with the same `PubSubController` which will open a new connection and resubscribe to all the channels which are tracked in the `PubSubController`.

The general pattern is therefore during program startup create a `PubSubController` and fork a thread which calls `pubSubForever` in a loop (using an exponential backoff algorithm such as the retry package to not hammer the Redis server if it does die). For example,

    myhandler :: ByteString -> IO ()
    myhandler msg = putStrLn $ unpack $ decodeUtf8 msg

    onInitialComplete :: IO ()
    onInitialComplete = putStrLn "Redis acknowledged that mychannel is now subscribed"

    main :: IO ()
    main = do
      conn <- connect defaultConnectInfo
      pubSubCtrl <- newPubSubController [("mychannel", myhandler)] []
      concurrently ( forever $
          pubSubForever conn pubSubCtrl onInitialComplete
            `catch` (\(e :: SomeException) -> do
              putStrLn $ "Got error: " ++ show e
              threadDelay $ 50*1000) -- TODO: use exponential backoff
           ) $ restOfYourProgram

      {- elsewhere in your program, use pubSubCtrl to change subscriptions -}

At most one active `pubSubForever` can be running against a single `PubSubController` at any time. If two active calls to `pubSubForever` share a single `PubSubController` there will be deadlocks. If you do want to process messages using multiple connections to Redis, you can create more than one `PubSubController`. For example, create one PubSubController for each `getNumCapabilities` and then create a Haskell thread bound to each capability each calling `pubSubForever` in a loop. This will create one network connection per controller/capability and allow you to register separate channels and callbacks for each controller, spreading the load across the capabilities.

newPubSubController Source #

Arguments

:: MonadIO m |
=> [(RedisChannel, MessageCallback)] | the initial subscriptions
-> [(RedisPChannel, PMessageCallback)] | the initial pattern subscriptions
-> m PubSubController |

Create a new `PubSubController`. Note that this does not subscribe to any channels, it just creates the controller. The subscriptions will happen once `pubSubForever` is called.

currentChannels :: MonadIO m => PubSubController -> m [RedisChannel] Source #

Get the list of current channels in the `PubSubController`. WARNING! This might not exactly reflect the subscribed channels in the Redis server, because there is a delay between adding or removing a channel in the `PubSubController` and when Redis receives and processes the subscription change request.

currentPChannels :: MonadIO m => PubSubController -> m [RedisPChannel] Source #

Get the list of current pattern channels in the `PubSubController`. WARNING! This might not exactly reflect the subscribed channels in the Redis server, because there is a delay between adding or removing a channel in the `PubSubController` and when Redis receives and processes the subscription change request.

addChannels Source #

Arguments

:: MonadIO m |
=> PubSubController |
-> [(RedisChannel, MessageCallback)] | the channels to subscribe to
-> [(RedisPChannel, PMessageCallback)] | the channels to pattern subscribe to
-> m UnregisterCallbacksAction |

Add channels into the `PubSubController`, and if there is an active `pubSubForever`, send the subscribe and psubscribe commands to Redis. The `addChannels` function is thread-safe. This function does not wait for Redis to acknowledge that the channels have actually been subscribed; use `addChannelsAndWait` for that.

You can subscribe to the same channel or pattern channel multiple times; the `PubSubController` keeps a list of callbacks and executes each callback in response to a message.

The return value is an action `UnregisterCallbacksAction` which will unregister the callbacks, which should typically used with `bracket`.

addChannelsAndWait Source #

Arguments

:: MonadIO m |
=> PubSubController |
-> [(RedisChannel, MessageCallback)] | the channels to subscribe to
-> [(RedisPChannel, PMessageCallback)] | the channels to psubscribe to
-> m UnregisterCallbacksAction |

Call `addChannels` and then wait for Redis to acknowledge that the channels are actually subscribed.

Note that this function waits for all pending subscription change requests, so if you for example call `addChannelsAndWait` from multiple threads simultaneously, they all will wait for all pending subscription changes to be acknowledged by Redis (this is due to the fact that we just track the total number of pending change requests sent to Redis and just wait until that count reaches zero).

This also correctly waits if the network connection dies during the subscription change. Say that the network connection dies right after we send a subscription change to Redis. `pubSubForever` will throw `ConnectionLost` and `addChannelsAndWait` will continue to wait. Once you recall `pubSubForever` with the same `PubSubController`, `pubSubForever` will open a new connection, send subscription commands for all channels in the `PubSubController` (which include the ones we are waiting for), and wait for the responses from Redis. Only once we receive the response from Redis that it has subscribed to all channels in `PubSubController` will `addChannelsAndWait` unblock and return.

removeChannels :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m () Source #

Remove channels from the `PubSubController`, and if there is an active `pubSubForever`, send the unsubscribe commands to Redis. Note that as soon as this function returns, no more callbacks will be executed even if more messages arrive during the period when we request to unsubscribe from the channel and Redis actually processes the unsubscribe request. This function is thread-safe.

If you remove all channels, the connection in `pubSubForever` to redis will stay open and waiting for any new channels from a call to `addChannels`. If you really want to close the connection, use `killThread` or `cancel` to kill the thread running `pubSubForever`.

removeChannelsAndWait :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m () Source #

Call `removeChannels` and then wait for all pending subscription change requests to be acknowledged by Redis. This uses the same waiting logic as `addChannelsAndWait`. Since `removeChannels` immediately notifies the `PubSubController` to start discarding messages, you likely don't need this function and can just use `removeChannels`.

watch Source #

Arguments

:: [ByteString] | key
-> Redis (Either Reply Status) |

Watch the given keys to determine execution of the MULTI/EXEC block (http://redis.io/commands/watch).

unwatch :: Redis (Either Reply Status) Source #

Forget about all watched keys (http://redis.io/commands/unwatch).

multiExec :: RedisTx (Queued a) -> Redis (TxResult a) Source #

Run commands inside a transaction. For documentation on the semantics of Redis transaction see http://redis.io/topics/transactions.

Inside the transaction block, command functions return their result wrapped in a `Queued`. The `Queued` result is a proxy object for the actual command's result, which will only be available after `EXEC`ing the transaction.

Example usage (note how `Queued` 's `Applicative` instance is used to combine the two individual results):

     runRedis conn $ do
         set "hello" "hello"
         set "world" "world"
         helloworld <- multiExec $ do
             hello <- get "hello"
             world <- get "world"
             return $ (,) <$> hello <*> world
         liftIO (print helloworld)

echo Source #

Arguments

:: RedisCtx m f |
=> ByteString | message
-> m (f ByteString) |

quit :: RedisCtx m f => m (f Status) Source #

del Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> m (f Integer) |

dump Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f ByteString) |

exists Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Bool) |

expire Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | seconds
-> m (f Bool) |

expireat Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | timestamp
-> m (f Bool) |

defaultMigrateOpts :: MigrateOpts Source #

Redis default `MigrateOpts`. Equivalent to omitting all optional parameters.

    MigrateOpts
        { migrateCopy    = False -- remove the key from the local instance
        , migrateReplace = False -- don't replace existing key on the remote instance
        }

migrateMultiple Source #

Arguments

:: RedisCtx m f |
=> ByteString | host
-> ByteString | port
-> Integer | destinationDb
-> Integer | timeout
-> MigrateOpts |
-> [ByteString] | keys
-> m (f Status) |

objectRefcount Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

objectEncoding Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f ByteString) |

objectIdletime Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

persist Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Bool) |

pexpire Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | milliseconds
-> m (f Bool) |

pexpireat Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | millisecondsTimestamp
-> m (f Bool) |

pttl Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

randomkey :: RedisCtx m f => m (f (Maybe ByteString)) Source #

renamenx Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | newkey
-> m (f Bool) |

restore Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | timeToLive
-> ByteString | serializedValue
-> m (f Status) |

restoreReplace Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | timeToLive
-> ByteString | serializedValue
-> m (f Status) |

cursor0 :: Cursor Source #

defaultScanOpts :: ScanOpts Source #

Redis default `ScanOpts`. Equivalent to omitting all optional parameters.

    ScanOpts
        { scanMatch = Nothing -- don't match any pattern
        , scanCount = Nothing -- don't set any requirements on number elements returned (works like value COUNT 10)
        }

scanOpts Source #

Arguments

:: RedisCtx m f |
=> Cursor |
-> ScanOpts |
-> m (f (Cursor, [ByteString])) | next cursor and values

defaultSortOpts :: SortOpts Source #

Redis default `SortOpts`. Equivalent to omitting all optional parameters.

    SortOpts
        { sortBy    = Nothing -- omit the BY option
        , sortLimit = (0,-1)  -- return entire collection
        , sortGet   = []      -- omit the GET option
        , sortOrder = Asc     -- sort in ascending order
        , sortAlpha = False   -- sort numerically, not lexicographically
        }

sortStore Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | destination
-> SortOpts |
-> m (f Integer) |

ttl Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

getType Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f RedisType) |

hdel Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | field
-> m (f Integer) |

hexists Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | field
-> m (f Bool) |

hget Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | field
-> m (f (Maybe ByteString)) |

hgetall Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f [(ByteString, ByteString)]) |

hincrby Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | field
-> Integer | increment
-> m (f Integer) |

hincrbyfloat Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | field
-> Double | increment
-> m (f Double) |

hkeys Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f [ByteString]) |

hlen Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

hmget Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | field
-> m (f [Maybe ByteString]) |

hmset Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [(ByteString, ByteString)] | fieldValue
-> m (f Status) |

hscan Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Cursor |
-> m (f (Cursor, [(ByteString, ByteString)])) | next cursor and values

hscanOpts Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Cursor |
-> ScanOpts |
-> m (f (Cursor, [(ByteString, ByteString)])) | next cursor and values

hset Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | field
-> ByteString | value
-> m (f Integer) |

hsetnx Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | field
-> ByteString | value
-> m (f Bool) |

hstrlen Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | field
-> m (f Integer) |

hvals Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f [ByteString]) |

pfadd Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | value
-> m (f Integer) |

pfcount Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> m (f Integer) |

pfmerge Source #

Arguments

:: RedisCtx m f |
=> ByteString | destkey
-> [ByteString] | sourcekey
-> m (f ByteString) |

blpop Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> Integer | timeout
-> m (f (Maybe (ByteString, ByteString))) |

brpop Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> Integer | timeout
-> m (f (Maybe (ByteString, ByteString))) |

brpoplpush Source #

Arguments

:: RedisCtx m f |
=> ByteString | source
-> ByteString | destination
-> Integer | timeout
-> m (f (Maybe ByteString)) |

lindex Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | index
-> m (f (Maybe ByteString)) |

linsertBefore Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | pivot
-> ByteString | value
-> m (f Integer) |

linsertAfter Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | pivot
-> ByteString | value
-> m (f Integer) |

llen Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

lpop Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f (Maybe ByteString)) |

lpush Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | value
-> m (f Integer) |

lpushx Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | value
-> m (f Integer) |

lrange Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | stop
-> m (f [ByteString]) |

lrem Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | count
-> ByteString | value
-> m (f Integer) |

lset Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | index
-> ByteString | value
-> m (f Status) |

ltrim Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | stop
-> m (f Status) |

rpop Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f (Maybe ByteString)) |

rpoplpush Source #

Arguments

:: RedisCtx m f |
=> ByteString | source
-> ByteString | destination
-> m (f (Maybe ByteString)) |

rpush Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | value
-> m (f Integer) |

rpushx Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | value
-> m (f Integer) |

eval Source #

Arguments

:: (RedisCtx m f, RedisResult a) |
=> ByteString | script
-> [ByteString] | keys
-> [ByteString] | args
-> m (f a) |

evalsha Source #

Arguments

:: (RedisCtx m f, RedisResult a) |
=> ByteString | base16-encoded sha1 hash of the script
-> [ByteString] | keys
-> [ByteString] | args
-> m (f a) |

Works like `eval`, but sends the SHA1 hash of the script instead of the script itself. Fails if the server does not recognise the hash, in which case, `eval` should be used instead.

scriptDebug :: RedisCtx m f => DebugMode -> m (f Bool) Source #

scriptExists Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | script
-> m (f [Bool]) |

scriptFlush :: RedisCtx m f => m (f Status) Source #

scriptKill :: RedisCtx m f => m (f Status) Source #

scriptLoad Source #

Arguments

:: RedisCtx m f |
=> ByteString | script
-> m (f ByteString) |

bgrewriteaof :: RedisCtx m f => m (f Status) Source #

bgsave :: RedisCtx m f => m (f Status) Source #

clientGetname :: RedisCtx m f => m (f Status) Source #

clientList :: RedisCtx m f => m (f [ByteString]) Source #

clientPause Source #

Arguments

:: RedisCtx m f |
=> Integer | timeout
-> m (f Status) |

clientReply :: RedisCtx m f => ReplyMode -> m (f Bool) Source #

clientSetname Source #

Arguments

:: RedisCtx m f |
=> ByteString | connectionName
-> m (f ByteString) |

commandCount :: RedisCtx m f => m (f Integer) Source #

commandInfo Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | commandName
-> m (f [ByteString]) |

configGet Source #

Arguments

:: RedisCtx m f |
=> ByteString | parameter
-> m (f [(ByteString, ByteString)]) |

configResetstat :: RedisCtx m f => m (f Status) Source #

configRewrite :: RedisCtx m f => m (f Status) Source #

configSet Source #

Arguments

:: RedisCtx m f |
=> ByteString | parameter
-> ByteString | value
-> m (f Status) |

dbsize :: RedisCtx m f => m (f Integer) Source #

debugObject Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f ByteString) |

flushall :: RedisCtx m f => m (f Status) Source #

flushdb :: RedisCtx m f => m (f Status) Source #

info :: RedisCtx m f => m (f ByteString) Source #

infoSection Source #

Arguments

:: RedisCtx m f |
=> ByteString | section
-> m (f ByteString) |

lastsave :: RedisCtx m f => m (f Integer) Source #

save :: RedisCtx m f => m (f Status) Source #

slaveof Source #

Arguments

:: RedisCtx m f |
=> ByteString | host
-> ByteString | port
-> m (f Status) |

slowlogGet Source #

Arguments

:: RedisCtx m f |
=> Integer | cnt
-> m (f [Slowlog]) |

slowlogLen :: RedisCtx m f => m (f Integer) Source #

slowlogReset :: RedisCtx m f => m (f Status) Source #

sadd Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | member
-> m (f Integer) |

scard Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

sdiff Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> m (f [ByteString]) |

sdiffstore Source #

Arguments

:: RedisCtx m f |
=> ByteString | destination
-> [ByteString] | key
-> m (f Integer) |

sinter Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> m (f [ByteString]) |

sinterstore Source #

Arguments

:: RedisCtx m f |
=> ByteString | destination
-> [ByteString] | key
-> m (f Integer) |

sismember Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | member
-> m (f Bool) |

smembers Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f [ByteString]) |

smove Source #

Arguments

:: RedisCtx m f |
=> ByteString | source
-> ByteString | destination
-> ByteString | member
-> m (f Bool) |

spop Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f (Maybe ByteString)) |

spopN Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | count
-> m (f [ByteString]) |

srandmember Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f (Maybe ByteString)) |

srandmemberN Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | count
-> m (f [ByteString]) |

srem Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | member
-> m (f Integer) |

sscan Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Cursor |
-> m (f (Cursor, [ByteString])) | next cursor and values

sscanOpts Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Cursor |
-> ScanOpts |
-> m (f (Cursor, [ByteString])) | next cursor and values

sunion Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> m (f [ByteString]) |

sunionstore Source #

Arguments

:: RedisCtx m f |
=> ByteString | destination
-> [ByteString] | key
-> m (f Integer) |

defaultZaddOpts :: ZaddOpts Source #

Redis default `ZaddOpts`. Equivalent to omitting all optional parameters.

    ZaddOpts
        { zaddCondition = Nothing -- omit NX and XX options
        , zaddChange    = False   -- don't modify the return value from the number of new elements added, to the total number of elements changed
        , zaddIncrement = False   -- don't add like ZINCRBY
        }

zadd Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [(Double, ByteString)] | scoreMember
-> m (f Integer) |

zaddOpts Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [(Double, ByteString)] | scoreMember
-> ZaddOpts | options
-> m (f Integer) |

zcard Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

zcount Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | min
-> Double | max
-> m (f Integer) |

zincrby Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | increment
-> ByteString | member
-> m (f Double) |

zinterstore Source #

Arguments

:: RedisCtx m f |
=> ByteString | destination
-> [ByteString] | keys
-> Aggregate |
-> m (f Integer) |

zinterstoreWeights Source #

Arguments

:: RedisCtx m f |
=> ByteString | destination
-> [(ByteString, Double)] | weighted keys
-> Aggregate |
-> m (f Integer) |

zlexcount Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | min
-> ByteString | max
-> m (f Integer) |

zrange Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | stop
-> m (f [ByteString]) |

zrangeWithscores Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | stop
-> m (f [(ByteString, Double)]) |

zrangebylex Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> RangeLex ByteString | min
-> RangeLex ByteString | max
-> m (f [ByteString]) |

zrangebylexLimit Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> RangeLex ByteString | min
-> RangeLex ByteString | max
-> Integer | offset
-> Integer | count
-> m (f [ByteString]) |

zrangebyscore Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | min
-> Double | max
-> m (f [ByteString]) |

zrangebyscoreWithscores Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | min
-> Double | max
-> m (f [(ByteString, Double)]) |

zrangebyscoreLimit Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | min
-> Double | max
-> Integer | offset
-> Integer | count
-> m (f [ByteString]) |

zrangebyscoreWithscoresLimit Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | min
-> Double | max
-> Integer | offset
-> Integer | count
-> m (f [(ByteString, Double)]) |

zrank Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | member
-> m (f (Maybe Integer)) |

zrem Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> [ByteString] | member
-> m (f Integer) |

zremrangebylex Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | min
-> ByteString | max
-> m (f Integer) |

zremrangebyrank Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | stop
-> m (f Integer) |

zremrangebyscore Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | min
-> Double | max
-> m (f Integer) |

zrevrange Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | stop
-> m (f [ByteString]) |

zrevrangeWithscores Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | stop
-> m (f [(ByteString, Double)]) |

zrevrangebyscore Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | max
-> Double | min
-> m (f [ByteString]) |

zrevrangebyscoreWithscores Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | max
-> Double | min
-> m (f [(ByteString, Double)]) |

zrevrangebyscoreLimit Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | max
-> Double | min
-> Integer | offset
-> Integer | count
-> m (f [ByteString]) |

zrevrangebyscoreWithscoresLimit Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | max
-> Double | min
-> Integer | offset
-> Integer | count
-> m (f [(ByteString, Double)]) |

zrevrank Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | member
-> m (f (Maybe Integer)) |

zscan Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Cursor |
-> m (f (Cursor, [(ByteString, Double)])) | next cursor and values

zscanOpts Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Cursor |
-> ScanOpts |
-> m (f (Cursor, [(ByteString, Double)])) | next cursor and values

zscore Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | member
-> m (f (Maybe Double)) |

zunionstore Source #

Arguments

:: RedisCtx m f |
=> ByteString | destination
-> [ByteString] | keys
-> Aggregate |
-> m (f Integer) |

zunionstoreWeights Source #

Arguments

:: RedisCtx m f |
=> ByteString | destination
-> [(ByteString, Double)] | weighted keys
-> Aggregate |
-> m (f Integer) |

bitcountRange Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | end
-> m (f Integer) |

bitopAnd Source #

Arguments

:: RedisCtx m f |
=> ByteString | destkey
-> [ByteString] | srckeys
-> m (f Integer) |

bitopOr Source #

Arguments

:: RedisCtx m f |
=> ByteString | destkey
-> [ByteString] | srckeys
-> m (f Integer) |

bitopXor Source #

Arguments

:: RedisCtx m f |
=> ByteString | destkey
-> [ByteString] | srckeys
-> m (f Integer) |

bitopNot Source #

Arguments

:: RedisCtx m f |
=> ByteString | destkey
-> ByteString | srckey
-> m (f Integer) |

bitpos Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | bit
-> Integer | start
-> Integer | end
-> m (f Integer) |

decr Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

decrby Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | decrement
-> m (f Integer) |

getbit Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | offset
-> m (f Integer) |

getrange Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | start
-> Integer | end
-> m (f ByteString) |

getset Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | value
-> m (f (Maybe ByteString)) |

incr Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

incrby Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | increment
-> m (f Integer) |

incrbyfloat Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Double | increment
-> m (f Double) |

mget Source #

Arguments

:: RedisCtx m f |
=> [ByteString] | key
-> m (f [Maybe ByteString]) |

mset Source #

Arguments

:: RedisCtx m f |
=> [(ByteString, ByteString)] | keyValue
-> m (f Status) |

msetnx Source #

Arguments

:: RedisCtx m f |
=> [(ByteString, ByteString)] | keyValue
-> m (f Bool) |

psetex Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | milliseconds
-> ByteString | value
-> m (f Status) |

setOpts Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | value
-> SetOpts |
-> m (f Status) |

setbit Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | offset
-> ByteString | value
-> m (f Integer) |

setex Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | seconds
-> ByteString | value
-> m (f Status) |

setnx Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | value
-> m (f Bool) |

setrange Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> Integer | offset
-> ByteString | value
-> m (f Integer) |

strlen Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> m (f Integer) |

defaultXreadOpts :: XReadOpts Source #

Redis default `XReadOpts`. Equivalent to omitting all optional parameters.

    XReadOpts
        { block = Nothing -- Don't block waiting for more records
        , recordCount    = Nothing   -- no record count
        }

xadd Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | id
-> [(ByteString, ByteString)] | (field, value)
-> m (f ByteString) |

xaddOpts Source #

Arguments

:: RedisCtx m f |
=> ByteString | key
-> ByteString | id
-> [(ByteString, ByteString)] | (field, value)
-> TrimOpts |
-> m (f ByteString) |

xread Source #

Arguments

:: RedisCtx m f |
=> [(ByteString, ByteString)] | (stream, id) pairs
-> m (f (Maybe [XReadResponse])) |

xreadOpts Source #

Arguments

:: RedisCtx m f |
=> [(ByteString, ByteString)] | (stream, id) pairs
-> XReadOpts | Options
-> m (f (Maybe [XReadResponse])) |

xreadGroup Source #

Arguments

:: RedisCtx m f |
=> ByteString | group name
-> ByteString | consumer name
-> [(ByteString, ByteString)] | (stream, id) pairs
-> m (f (Maybe [XReadResponse])) |

xreadGroupOpts Source #

Arguments

:: RedisCtx m f |
=> ByteString | group name
-> ByteString | consumer name
-> [(ByteString, ByteString)] | (stream, id) pairs
-> XReadOpts | Options
-> m (f (Maybe [XReadResponse])) |

xack Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group name
-> [ByteString] | message IDs
-> m (f Integer) |

xgroupCreate Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group name
-> ByteString | start ID
-> m (f Status) |

xgroupSetId Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> ByteString | id
-> m (f Status) |

xgroupDestroy Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> m (f Bool) |

xgroupDelConsumer Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> ByteString | consumer
-> m (f Integer) |

xrange Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | start
-> ByteString | end
-> Maybe Integer | COUNT
-> m (f [StreamsRecord]) |

xrevRange Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | end
-> ByteString | start
-> Maybe Integer | COUNT
-> m (f [StreamsRecord]) |

xlen Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> m (f Integer) |

xpendingSummary Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> Maybe ByteString | consumer
-> m (f XPendingSummaryResponse) |

xpendingDetail Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> ByteString | startId
-> ByteString | endId
-> Integer | count
-> Maybe ByteString | consumer
-> m (f [XPendingDetailRecord]) |

defaultXClaimOpts :: XClaimOpts Source #

xclaim Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> ByteString | consumer
-> Integer | min idle time
-> XClaimOpts | optional arguments
-> [ByteString] | message IDs
-> m (f [StreamsRecord]) |

xclaimJustIds Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> ByteString | consumer
-> Integer | min idle time
-> XClaimOpts | optional arguments
-> [ByteString] | message IDs
-> m (f [ByteString]) |

xinfoConsumers Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> ByteString | group
-> m (f [XInfoConsumersResponse]) |

xinfoGroups Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> m (f [XInfoGroupsResponse]) |

xinfoStream Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> m (f XInfoStreamResponse) |

xdel Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> [ByteString] | message IDs
-> m (f Integer) |

xtrim Source #

Arguments

:: RedisCtx m f |
=> ByteString | stream
-> TrimOpts |
-> m (f Integer) |

inf :: RealFloat a => a Source #

clusterNodes :: RedisCtx m f => m (f ClusterNodesResponse) Source #

clusterSetSlotNode :: RedisCtx m f => Integer -> ByteString -> m (f Status) Source #

clusterSetSlotStable :: RedisCtx m f => Integer -> m (f Status) Source #

clusterSetSlotImporting :: RedisCtx m f => Integer -> ByteString -> m (f Status) Source #

clusterSetSlotMigrating :: RedisCtx m f => Integer -> ByteString -> m (f Status) Source #

clusterGetKeysInSlot :: RedisCtx m f => Integer -> Integer -> m (f [ByteString]) Source #