A threadsafe pool of network connections to a Redis server. Use the connect function to create one.
Modulehedis-0.16.4Haskell2010
Database.Redis
- 17 types
- 4 classes
- 16 values
- Packagehedis-0.16.4
- Exports37
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceConnection.hs
How To Use This Package
0 declarationsSimplest usage of this package is to connect to a Redis server and run commands against it and close connection when done:
Connect to a Redis server:
let Right ci = parseConnectInfo "redis://localhost:6379"
conn <- checkedConnect ci
connect or checkedConnect creates a connection pool under the hood. This poll manages reuse of the connections connection livetimes, and connection restore in the case of the connection loss.
Send commands to the server:
{-# LANGUAGE OverloadedStrings #-}
...
runRedis conn $ do
set "hello" "hello"
set "world" "world"
hello <- get "hello"
world <- get "world"
liftIO $ print (hello,world)
disconnect all idle resources in the connection pool, and destroy the pool:
disconnect conn
Managing connections
Redis connections are managed by a connection pool enclosed in the Connection type, that keeps all required state.
To create a connection one need to contruct a ConnectInfo record. The easiest way to do this is to use the parseConnectInfo function, which takes a URL and returns a ConnectInfo record.
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"}
Or better yet, use parseConnectInfo to parse a URL.
Constructors
ConnInfoconnectAddr :: !ConnectAddrconnectAuth :: !Maybe ByteStringWhen the server is protected by a password, set connectAuth to Just the password. Each connection will then authenticate by the
authcommand.connectUsername :: !Maybe ByteStringWhen ACL is used set connectUsername as the user.
connectDatabase :: !IntegerEach connection will select the database with the given index.
connectMaxConnections :: !IntMaximum number of connections to keep open. The smallest acceptable value is 1.
connectNumStripes :: !Maybe IntNumber of stripes in the connection pool.
connectMaxIdleTime :: !NominalDiffTimeAmount of time for which an unused connection is kept open. The smallest acceptable value is 0.5 seconds. If the
timeoutvalue in your redis.conf file is non-zero, it should be larger than connectMaxIdleTime.connectTimeout :: !Maybe NominalDiffTimeOptional timeout until connection to Redis gets established.
ConnectTimeoutExceptiongets thrown if no socket get connected in this interval of time.connectTLSParams :: !Maybe ClientParamsOptional TLS parameters. TLS will be enabled if this is provided.
connectHooks :: !HooksConnection hooks. See Database.Redis.Hooks for usage and examples.
connectPoolLabel :: !TextLabel of the connection pool for instrumentation.
Instances1Show
Show ConnectInfoDefined in hedis-0.16.4 · Database.Redis.Connection
Instances2Eq, Show
Eq ConnectAddrDefined in hedis-0.16.4 · Database.Redis.ConnectionContextShow ConnectAddrDefined in hedis-0.16.4 · Database.Redis.ConnectionContext
Default information for connecting:
connectAddr = ConnectAddrHostPort "localhost" 6379 -- Redis default port
connectAuth = Nothing -- No password
connectUsername = Nothing -- No user
connectDatabase = 0 -- SELECT database 0
connectMaxConnections = 50 -- Up to 50 connections
connectNumStripes = Just 1 -- A single stripe
connectMaxIdleTime = 30 -- Keep open for 30 seconds
connectTimeout = Nothing -- Don't add timeout logic
connectTLSParams = Nothing -- Do not use TLS
connectHooks = defaultHooks -- Do nothing
connectPoolLabel = "" -- no label
Parse a ConnectInfo from a URL according to the Rules in Redis client
Standalone Redis:
redis :// [[username :] password@] host [:port][/database]
parseConnectInfo "redis://username:password@host:42/2"Right (ConnInfo {connectAddr = ConnectAddrHostPort "host" 42, connectAuth = Just "password", connectUsername = Just "username", connectDatabase = 2, connectMaxConnections = 50, connectNumStripes = Just 1, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing, connectHooks = Hooks {...}, connectPoolLabel = ""})
parseConnectInfo "redis://password@host:42/2"Right (ConnInfo {connectAddr = ConnectAddrHostPort "host" 42, connectAuth = Just "password", connectUsername = Nothing, connectDatabase = 2, connectMaxConnections = 50, connectNumStripes = Just 1, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing, connectHooks = Hooks {...}, connectPoolLabel = ""})
TLS-enabled Redis:
rediss :// [[username :] password@] host [: port][/database]
Unix socket Redis:
redis-socket :// [[username :] password@]path [? [&database=database]
parseConnectInfo "redis-socket://password@/tmp/redis.sock?database=2"Right (ConnInfo {connectAddr = ConnectAddrUnixSocket "/tmp/redis.sock", connectAuth = Just "password", connectUsername = Nothing, connectDatabase = 2, connectMaxConnections = 50, connectNumStripes = Just 1, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing, connectHooks = Hooks {...}, connectPoolLabel = ""})
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 postgres:"
Beyond that, all values are optional. Omitted values are taken from
defaultConnectInfo:
parseConnectInfo "rediss://"Right (ConnInfo {connectAddr = ConnectAddrHostPort "localhost" 6379, connectAuth = Nothing, connectUsername = Nothing, connectDatabase = 0, connectMaxConnections = 50, connectNumStripes = Just 1, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Just (ClientParams ...), connectHooks = Hooks {...}, connectPoolLabel = ""})
Destroy all idle resources in the pool, works for all types of the connection.
Single node
If you are connecting to a single Redis node, use the connect or checkedConnect functions.
Constructs a Connection pool to a Redis server designated by the given ConnectInfo.
The function always succeeds, because the first connection is not actually established until the first call to the server.
Constructs a Connection pool to a Redis server designated by the given ConnectInfo, then tests if the server is actually there.
Throws an ConnectError exception if the connection to the Redis server can't be established.
Memory bracket around connect and disconnect.
Memory bracket around checkedConnect and disconnect
Constructors
Instances3Eq, Show, Exception
Eq ConnectErrorDefined in hedis-0.16.4 · Database.Redis.ConnectionShow ConnectErrorDefined in hedis-0.16.4 · Database.Redis.ConnectionException ConnectErrorDefined in hedis-0.16.4 · Database.Redis.Connection
Clustered
If you are connecting to a Redis cluster, use the connectCluster or checkedConnectCluster functions.
At this point, some functions are not supported in the cluster mode:
CONFIG
AUTH
SCAN
MOVE, SELECT
RESET
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 - RESET
Constructs a Connection pool to a Redis cluster designated by the given ConnectInfo, then tests if the server is actually there.
Throws an ClusterConnectError exception if the connection to the Redis server can't be established.
Constructors
Instances3Eq, Show, Exception
Eq ClusterConnectErrorDefined in hedis-0.16.4 · Database.Redis.ConnectionShow ClusterConnectErrorDefined in hedis-0.16.4 · Database.Redis.ConnectionException ClusterConnectErrorDefined in hedis-0.16.4 · Database.Redis.Connection
Sentinel
If you are connecting to a Redis sentinel, use functions from the Database.Redis.Sentinel module,
such as connect or Database.Redis.Sentinel.checkedConnectSentinel.
Those functions live in a separate module to simplify move from the Single-node to Sentinel mode.
Running Commands
Redis commands behave differently when issued in- or outside of a transaction. To make them work in both contexts, most command functions have a type signature similar to the following:
echo :: (RedisCtx m f) => ByteString -> m (f ByteString)
Here is how to interpret this type signature:
The argument types are independent of the execution context. echo always takes a
ByteStringparameter, whether in- or outside of a transaction. This is true for all command functions.All Redis commands return their result wrapped in some "container". The type
fof this container depends on the commands execution contextm. TheByteStringreturn type in the example is specific to the echo command. For other commands, it will often be another type.In the "normal" context Redis, outside of any transactions, results are wrapped in an
Either Reply.Inside a transaction, in the RedisTx context, results are wrapped in a Queued.
In short, you can view any command with a RedisCtx constraint in the type signature, to "have two types". For example echo "has both types":
echo :: ByteString -> Redis (Either Reply ByteString)
echo :: ByteString -> RedisTx (Queued ByteString)
To see all commands refer to the Database.Redis.Commands module:
module Database.Redis.Commands
It's important to understand several features that the library provides.
Automatic Pipelining
Commands are automatically pipelined as much as possible. For example, in the above "hello world" example, all four commands are pipelined. Automatic pipelining makes use of Haskell's laziness. As long as a previous reply is not evaluated, subsequent commands can be pipelined.
Automatic pipelining is limited to the scope of runRedis call and it is guaranteed that every reply expected as a part of runRedis execution gets received after runRedis invocation.
To keep memory usage low, the number of requests "in the pipeline" is limited (per connection) to 1000. After that number, the next command is sent only when at least one reply has been received. That means, command functions may block until there are less than 1000 outstanding replies.
This feature has several implications. Consider the following example:
runRedis conn $ do
set "key1" "value1"
_ <- get "nonexistingkey"
set "key2" "value2"
Even the "nonexistingkey" does not exist and would return a error it does not
prevent commands from execution, so both key1 and key2 will be updated.
To enforce verification of the reply one could wrap commands in ExceptT:
runRedis conn $ runExceptT $ do
ExceptT $ set "key1" "value1"
_ <- ExceptT $get "nonexistingkey"
ExceptT $ set "key2" "value2"
But this code will break the pipelining and second command will be sent only after first command reply is received.
Error Behavior
- Operations against keys holding the wrong kind of value:
Outside of a transaction, if the Redis server returns an
, command functions will return
the
. The library user can inspect the error message to gain information on what kind of error occured.
- Connection to the server lost:
In case of a lost connection, command functions throw a
. It can only be caught outside of
.
- Trying to connect to an unreachable server:
When trying to connect to a server that does not exist or can't be reached, the connection pool only starts the first connection when actually executing a call to the server. This can lead to discovering very late that the server is not available, for example when running a server that logs to Redis. To prevent this, run a
command directly after connecting or use the
function which encapsulates this behavior.
- Exceptions:
Any exceptions can only be caught
outside
of
. This way the connection pool can properly close the connection, making sure it is not left in an unusable state, e.g. closed or inside a transaction.
Transactions
hedis supports Redis transactions. See Database.Redis.Transactions for more information.
module Database.Redis.Transactions
Pub/Sub
hedis supports Redis Pub/Sub. See Database.Redis.PubSub for more information.
module Database.Redis.PubSub
Advanced Usage
0 declarationsThe Redis Monad
Instances11Monad, Functor, MonadFail, Applicative, MonadIO, MonadCatch, …
Monad RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalFunctor RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalMonadFail RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalApplicative RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalMonadIO RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalMonadCatch RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalMonadMask RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalMonadThrow RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalMonadUnliftIO RedisDefined in hedis-0.16.4 · Database.Redis.Core.InternalMonadRedis RedisDefined in hedis-0.16.4 · Database.Redis.CoreRedisCtx Redis (Either Reply)Defined in hedis-0.16.4 · Database.Redis.Core
Interact with a Redis datastore specified by the given Connection.
Each call of runRedis takes a network connection from the Connection pool and runs the given Redis action. Calls to runRedis may thus block while all connections from the pool are in use.
Interact with a Redis datastore specified by the given Connection, but return early if acquiring from the connection pool would block.
Like runRedis, but if all connections in the Connection pool are used, it immediately returns Nothing. This can be useful for logging purposes.
Reconstruct Redis constructor.
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)
Instances3MonadRedis
MonadRedis RedisDefined in hedis-0.16.4 · Database.Redis.CoreMonadRedis RedisTxDefined in hedis-0.16.4 · Database.Redis.Transactions(MonadTrans t, MonadRedis m, Monad (t m)) => MonadRedis (t m)Defined in hedis-0.16.4 · Database.Redis.Core
Lua Scripting
Lua values returned from the eval and evalsha functions will be converted to Haskell values by the decode function from the RedisResult type class.
Lua Type | Haskell Type | Conversion Example
--------------|--------------------|-----------------------------
Number | Integer | 1.23 => 1
String | ByteString, Double | "1.23" => "1.23" or 1.23
Boolean | Bool | false => False
Table | List | {1,2} => [1,2]
Additionally, any of the Haskell types from the table above can be wrapped in a Maybe:
42 => Just 42 :: Maybe Integer
nil => Nothing :: Maybe Integer
Note that Redis imposes some limitations on the possible conversions:
Lua numbers can only be converted to Integers. Only Lua strings can be interpreted as Doubles.
Associative Lua tables can not be converted at all. Returned tables must be "arrays", i.e. indexed only by integers.
The Redis Scripting website (http://redis.io/commands/eval) documents the exact semantics of the scripting commands and value conversion.
Hooks
A collection of hook functions used by a connection.
Constructors
A hook for sending commands to the server and receiving replies from the server.
This wraps the command-level request path used by most Redis commands.
A hook for sending pub/sub messages to the server.
A hook for invoking callbacks with pub/sub messages.
A hook for sending raw bytes to the server.
This sits below request rendering and can be used to observe the exact wire payload sent on the socket.
A hook for receiving replies from the server.
The default hooks.
Every hook is the identity function, so installing defaultHooks has no effect on behavior.
Low-Level Command API
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]
Low-level representation of replies from the Redis server.
Constructors
Instances7Eq, Show, Generic, NFData, RedisResult, RedisCtx, …
Eq ReplyDefined in hedis-0.16.4 · Database.Redis.ProtocolShow ReplyDefined in hedis-0.16.4 · Database.Redis.ProtocolGeneric ReplyDefined in hedis-0.16.4 · Database.Redis.ProtocolNFData ReplyDefined in hedis-0.16.4 · Database.Redis.ProtocolRedisResult ReplyDefined in hedis-0.16.4 · Database.Redis.TypesRedisCtx Redis (Either Reply)Defined in hedis-0.16.4 · Database.Redis.Coretype Rep Reply = D1 ('MetaDataDefined in hedis-0.16.4 · Database.Redis.Protocol"Reply"
"Database.Redis.Protocol"
"hedis-0.16.4-BAFrhQyI18yAZNv2y56JT1"
'False) ((C1 ('MetaCons"SingleLine"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons"Error"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) :+: (C1 ('MetaCons"Integer"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :+: (C1 ('MetaCons"Bulk"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ByteString))) :+: C1 ('MetaCons"MultiBulk"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Reply]))))))
Constructors
Instances6Eq, Show, Generic, NFData, RedisResult, Rep
Eq StatusDefined in hedis-0.16.4 · Database.Redis.TypesShow StatusDefined in hedis-0.16.4 · Database.Redis.TypesGeneric StatusDefined in hedis-0.16.4 · Database.Redis.TypesNFData StatusDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult StatusDefined in hedis-0.16.4 · Database.Redis.Typestype Rep Status = D1 ('MetaDataDefined in hedis-0.16.4 · Database.Redis.Types"Status"
"Database.Redis.Types"
"hedis-0.16.4-BAFrhQyI18yAZNv2y56JT1"
'False) (C1 ('MetaCons"Ok"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"Pong"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Status"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))
Methods
encode :: a -> ByteString
Instances35RedisArg, …
RedisArg ByteStringDefined in hedis-0.16.4 · Database.Redis.TypesRedisArg IntegerDefined in hedis-0.16.4 · Database.Redis.TypesRedisArg Int64Defined in hedis-0.16.4 · Database.Redis.TypesRedisArg DoubleDefined in hedis-0.16.4 · Database.Redis.TypesRedisArg BitposTypeDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg ClusterSlotStatsMetricDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg ConditionDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg CursorDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg DebugModeDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg ExpireOptsDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg FlushOptsDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg FunctionRestorePolicyDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg GeoOrderDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg GeoUnitDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg HSetExConditionDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg HotkeysMetricDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg ListDirectionDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg ReplyModeDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg SizeConditionDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg VAddQuantizationDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg VQuantizationDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg XNackModeDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg XRefPolicyDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg ZPopMinMaxDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisArg FTIndexAllModeDefined in hedis-0.16.4 · Database.Redis.ManualCommands.FTRedisArg FTOnDefined in hedis-0.16.4 · Database.Redis.ManualCommands.FTRedisArg FTProfileQueryTypeDefined in hedis-0.16.4 · Database.Redis.ManualCommands.FTRedisArg JSONSetConditionDefined in hedis-0.16.4 · Database.Redis.ManualCommands.JSONRedisArg JSONSetFPHADefined in hedis-0.16.4 · Database.Redis.ManualCommands.JSONRedisArg TsAggregatorDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TsRedisArg TsAggregatorsDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TsRedisArg TsBucketTimestampDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TsRedisArg TsDuplicatePolicyDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TsRedisArg TsEncodingDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TsRedisArg a => RedisArg (RangeLex a)Defined in hedis-0.16.4 · Database.Redis.ManualCommands
Instances58RedisResult, …
RedisResult ByteStringDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult IntegerDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult Int64Defined in hedis-0.16.4 · Database.Redis.TypesRedisResult BoolDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult DoubleDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult CommandInfoDefined in hedis-0.16.4 · Database.Redis.Cluster.CommandRedisResult ARIndexValuePairsResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ARInfoResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterInfoResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterMigrationStatusResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterMigrationTaskDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterNodesResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterSlotStatsResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterSlotStatsResponseEntryDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterSlotsNodeDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterSlotsResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ClusterSlotsResponseEntryDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult CursorDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult GeoCoordinatesDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult GeoLocationDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult HashFieldExpirationInfoDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult HashFieldExpirationStatusDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult HotkeysGetResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult HotkeysSlotRangeDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult SlowlogDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult StreamsRecordDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult VEmbRawResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult VInfoResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult VLinksResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult VLinksWithScoresResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult VQuantizationDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult VSimWithAttribsResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult VSimWithAttribsResultDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult XEntryDeletionResultDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult XInfoConsumersResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult XInfoGroupsResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult XInfoStreamResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult XPendingDetailRecordDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult XPendingSummaryResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult XReadResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult ZPopResponseDefined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult BFInfoDefined in hedis-0.16.4 · Database.Redis.ManualCommands.BFRedisResult CFInfoDefined in hedis-0.16.4 · Database.Redis.ManualCommands.CFRedisResult CFInsertResultDefined in hedis-0.16.4 · Database.Redis.ManualCommands.CFRedisResult CMSInfoDefined in hedis-0.16.4 · Database.Redis.ManualCommands.CmsRedisResult TDigestInfoDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TdigestRedisResult TopkInfoDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TopkRedisResult TsSampleDefined in hedis-0.16.4 · Database.Redis.ManualCommands.TsRedisResult WaitAofResultDefined in hedis-0.16.4 · Database.Redis.ManualCommands.WaitRedisResult ReplyDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult RedisTypeDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult StatusDefined in hedis-0.16.4 · Database.Redis.TypesRedisResult a => RedisResult (Maybe a)Defined in hedis-0.16.4 · Database.Redis.TypesRedisResult a => RedisResult (XAutoclaimResult a)Defined in hedis-0.16.4 · Database.Redis.ManualCommandsRedisResult a => RedisResult [a]Defined in hedis-0.16.4 · Database.Redis.Types(RedisResult k, RedisResult v) => RedisResult [(k, v)]Defined in hedis-0.16.4 · Database.Redis.Types(RedisResult a, RedisResult b) => RedisResult (a, b)Defined in hedis-0.16.4 · Database.Redis.Types(RedisResult a, RedisResult b, RedisResult c) => RedisResult (a, b, c)Defined in hedis-0.16.4 · Database.Redis.Types
Instances2Show, Exception
Show ConnectionLostExceptionDefined in hedis-0.16.4 · Database.Redis.ConnectionContextException ConnectionLostExceptionDefined in hedis-0.16.4 · Database.Redis.ConnectionContext
Constructors
ConnectTimeout ConnectPhase
Instances2Show, Exception
Show ConnectTimeoutDefined in hedis-0.16.4 · Database.Redis.ConnectionContextException ConnectTimeoutDefined in hedis-0.16.4 · Database.Redis.ConnectionContext
Instances7Enum, Eq, Integral, Num, Ord, Real, …
Enum HashSlotDefined in hedis-0.16.4 · Database.Redis.Cluster.HashSlotEq HashSlotDefined in hedis-0.16.4 · Database.Redis.Cluster.HashSlotIntegral HashSlotDefined in hedis-0.16.4 · Database.Redis.Cluster.HashSlotNum HashSlotDefined in hedis-0.16.4 · Database.Redis.Cluster.HashSlotOrd HashSlotDefined in hedis-0.16.4 · Database.Redis.Cluster.HashSlotReal HashSlotDefined in hedis-0.16.4 · Database.Redis.Cluster.HashSlotShow HashSlotDefined in hedis-0.16.4 · Database.Redis.Cluster.HashSlot
Compute the hashslot associated with a key
keyToSlot "123"HashSlot 5970keyToSlot "{123"HashSlot 2872keyToSlot "{123}"HashSlot 5970keyToSlot "{}123"HashSlot 7640keyToSlot "{123}1{abc}"HashSlot 5970keyToSlot "\00\01"HashSlot 4129