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

Safe HaskellSafe-Infered

Database.Redis

Contents

Synopsis

How To Use This Module

Connect to a Redis server:

 -- connects to localhost:6379
 conn <- connect defaultConnectInfo

Send commands to the server:

 runRedis conn $ do
      set "hello" "hello"
      set "world" "world"
      hello <- get "hello"
      world <- get "world"
      liftIO $ print (hello,world)

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 also works across several calls to runRedis, as long as replies are only evaluated outside the runRedis block.

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.

Error Behavior

Operations against keys holding the wrong kind of value:
If the Redis server returns an Error, command functions will return Left the Reply. 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 ConnectionLostException. It can only be caught outside of runRedis, to make sure the connection pool can properly destroy the connection.

The Redis Monad

data Redis a Source

All Redis commands run in the Redis monad.

runRedis :: Connection -> Redis a -> IO aSource

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.

Connection

data Connection Source

A threadsafe pool of network connections to a Redis server. Use the connect function to create one.

connect :: ConnectInfo -> IO ConnectionSource

Opens a Connection to a Redis server designated by the given ConnectInfo.

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
 
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.

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.

defaultConnectInfo :: ConnectInfoSource

Default information for connecting:

  connectHost           = "localhost"
  connectPort           = PortNumber 6379 -- Redis default port
  connectAuth           = Nothing         -- No password
  connectMaxConnections = 50              -- Up to 50 connections
  connectMaxIdleTime    = 30              -- Keep open for 30 seconds

type HostName = String

Either a host name e.g., "haskell.org" or a numeric host address string consisting of a dotted decimal IPv4 address or an IPv6 address e.g., "192.168.0.1".

Commands

Connection

authSource

Arguments

:: ByteString

password

-> Redis (Either Reply Status) 

Authenticate to the server (http://redis.io/commands/auth).

Echo the given string (http://redis.io/commands/echo).

Ping the server (http://redis.io/commands/ping).

Close the connection (http://redis.io/commands/quit).

selectSource

Arguments

:: Integer

index

-> Redis (Either Reply Status) 

Change the selected database for the current connection (http://redis.io/commands/select).

Keys

delSource

Arguments

:: [ByteString]

key

-> Redis (Either Reply Integer) 

Determine if a key exists (http://redis.io/commands/exists).

expireSource

Arguments

:: ByteString

key

-> Integer

seconds

-> Redis (Either Reply Bool) 

Set a key's time to live in seconds (http://redis.io/commands/expire).

expireatSource

Arguments

:: ByteString

key

-> Integer

timestamp

-> Redis (Either Reply Bool) 

Set the expiration for a key as a UNIX timestamp (http://redis.io/commands/expireat).

keysSource

Arguments

:: ByteString

pattern

-> Redis (Either Reply [ByteString]) 

Find all keys matching the given pattern (http://redis.io/commands/keys).

moveSource

Arguments

:: ByteString

key

-> Integer

db

-> Redis (Either Reply Bool) 

Move a key to another database (http://redis.io/commands/move).

Inspect the internals of Redis objects (http://redis.io/commands/object). The Redis command OBJECT is split up into objectRefcount, objectEncoding, objectIdletime.

Inspect the internals of Redis objects (http://redis.io/commands/object). The Redis command OBJECT is split up into objectRefcount, objectEncoding, objectIdletime.

Inspect the internals of Redis objects (http://redis.io/commands/object). The Redis command OBJECT is split up into objectRefcount, objectEncoding, objectIdletime.

Remove the expiration from a key (http://redis.io/commands/persist).

Return a random key from the keyspace (http://redis.io/commands/randomkey).

renameSource

Arguments

:: ByteString

key

-> ByteString

newkey

-> Redis (Either Reply Status) 

renamenxSource

Arguments

:: ByteString

key

-> ByteString

newkey

-> Redis (Either Reply Bool) 

Rename a key, only if the new key does not exist (http://redis.io/commands/renamenx).

data SortOpts Source

Options for the sort command.

Instances

defaultSortOpts :: SortOptsSource

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
     }

data SortOrder Source

Constructors

Asc 
Desc 

Sort the elements in a list, set or sorted set (http://redis.io/commands/sort). The Redis command SORT is split up into sort, sortStore.

sortStoreSource

Arguments

:: ByteString

key

-> ByteString

destination

-> SortOpts 
-> Redis (Either Reply Integer) 

Sort the elements in a list, set or sorted set (http://redis.io/commands/sort). The Redis command SORT is split up into sort, sortStore.

Get the time to live for a key (http://redis.io/commands/ttl).

Determine the type stored at key (http://redis.io/commands/type).

Hashes

hdelSource

Arguments

:: ByteString

key

-> [ByteString]

field

-> Redis (Either Reply Bool) 

Delete one or more hash fields (http://redis.io/commands/hdel).

Determine if a hash field exists (http://redis.io/commands/hexists).

Get the value of a hash field (http://redis.io/commands/hget).

Get all the fields and values in a hash (http://redis.io/commands/hgetall).

hincrbySource

Arguments

:: ByteString

key

-> ByteString

field

-> Integer

increment

-> Redis (Either Reply Integer) 

Increment the integer value of a hash field by the given number (http://redis.io/commands/hincrby).

Get all the fields in a hash (http://redis.io/commands/hkeys).

Get the number of fields in a hash (http://redis.io/commands/hlen).

Get the values of all the given hash fields (http://redis.io/commands/hmget).

hmsetSource

Arguments

:: ByteString

key

-> [(ByteString, ByteString)]

fieldValue

-> Redis (Either Reply Status) 

Set multiple hash fields to multiple values (http://redis.io/commands/hmset).

hsetSource

Arguments

:: ByteString

key

-> ByteString

field

-> ByteString

value

-> Redis (Either Reply Bool) 

Set the string value of a hash field (http://redis.io/commands/hset).

hsetnxSource

Arguments

:: ByteString

key

-> ByteString

field

-> ByteString

value

-> Redis (Either Reply Bool) 

Set the value of a hash field, only if the field does not exist (http://redis.io/commands/hsetnx).

Get all the values in a hash (http://redis.io/commands/hvals).

Lists

blpopSource

Arguments

:: [ByteString]

key

-> Integer

timeout

-> Redis (Either Reply (Maybe (ByteString, ByteString))) 

Remove and get the first element in a list, or block until one is available (http://redis.io/commands/blpop).

brpopSource

Arguments

:: [ByteString]

key

-> Integer

timeout

-> Redis (Either Reply (Maybe (ByteString, ByteString))) 

Remove and get the last element in a list, or block until one is available (http://redis.io/commands/brpop).

brpoplpushSource

Arguments

:: ByteString

source

-> ByteString

destination

-> Integer

timeout

-> Redis (Either Reply (Maybe ByteString)) 

Pop a value from a list, push it to another list and return it; or block until one is available (http://redis.io/commands/brpoplpush).

Get an element from a list by its index (http://redis.io/commands/lindex).

Insert an element before or after another element in a list (http://redis.io/commands/linsert). The Redis command LINSERT is split up into linsertBefore, linsertAfter.

Insert an element before or after another element in a list (http://redis.io/commands/linsert). The Redis command LINSERT is split up into linsertBefore, linsertAfter.

Get the length of a list (http://redis.io/commands/llen).

Remove and get the first element in a list (http://redis.io/commands/lpop).

lpushSource

Arguments

:: ByteString

key

-> [ByteString]

value

-> Redis (Either Reply Integer) 

Prepend one or multiple values to a list (http://redis.io/commands/lpush).

Prepend a value to a list, only if the list exists (http://redis.io/commands/lpushx).

lrangeSource

Arguments

:: ByteString

key

-> Integer

start

-> Integer

stop

-> Redis (Either Reply [ByteString]) 

Get a range of elements from a list (http://redis.io/commands/lrange).

lremSource

Arguments

:: ByteString

key

-> Integer

count

-> ByteString

value

-> Redis (Either Reply Integer) 

Remove elements from a list (http://redis.io/commands/lrem).

lsetSource

Arguments

:: ByteString

key

-> Integer

index

-> ByteString

value

-> Redis (Either Reply Status) 

Set the value of an element in a list by its index (http://redis.io/commands/lset).

ltrimSource

Arguments

:: ByteString

key

-> Integer

start

-> Integer

stop

-> Redis (Either Reply Status) 

Trim a list to the specified range (http://redis.io/commands/ltrim).

Remove and get the last element in a list (http://redis.io/commands/rpop).

rpoplpushSource

Arguments

:: ByteString

source

-> ByteString

destination

-> Redis (Either Reply (Maybe ByteString)) 

Remove the last element in a list, append it to another list and return it (http://redis.io/commands/rpoplpush).

rpushSource

Arguments

:: ByteString

key

-> [ByteString]

value

-> Redis (Either Reply Integer) 

Append one or multiple values to a list (http://redis.io/commands/rpush).

Append a value to a list, only if the list exists (http://redis.io/commands/rpushx).

Server

Asynchronously rewrite the append-only file (http://redis.io/commands/bgrewriteaof).

Asynchronously save the dataset to disk (http://redis.io/commands/bgsave).

Get the value of a configuration parameter (http://redis.io/commands/config-get).

Reset the stats returned by INFO (http://redis.io/commands/config-resetstat).

configSetSource

Arguments

:: ByteString

parameter

-> ByteString

value

-> Redis (Either Reply Status) 

Set a configuration parameter to the given value (http://redis.io/commands/config-set).

Return the number of keys in the selected database (http://redis.io/commands/dbsize).

Get debugging information about a key (http://redis.io/commands/debug-object).

Make the server crash (http://redis.io/commands/debug-segfault).

Remove all keys from all databases (http://redis.io/commands/flushall).

Remove all keys from the current database (http://redis.io/commands/flushdb).

Get information and statistics about the server (http://redis.io/commands/info).

Get the UNIX time stamp of the last successful save to disk (http://redis.io/commands/lastsave).

Synchronously save the dataset to disk (http://redis.io/commands/save).

Synchronously save the dataset to disk and then shut down the server (http://redis.io/commands/shutdown).

Make the server a slave of another instance, or promote it as master (http://redis.io/commands/slaveof).

Manages the Redis slow queries log (http://redis.io/commands/slowlog). The Redis command SLOWLOG is split up into slowlogGet, slowlogLen, slowlogReset.

Manages the Redis slow queries log (http://redis.io/commands/slowlog). The Redis command SLOWLOG is split up into slowlogGet, slowlogLen, slowlogReset.

Manages the Redis slow queries log (http://redis.io/commands/slowlog). The Redis command SLOWLOG is split up into slowlogGet, slowlogLen, slowlogReset.

Sets

saddSource

Arguments

:: ByteString

key

-> [ByteString]

member

-> Redis (Either Reply Integer) 

Add one or more members to a set (http://redis.io/commands/sadd).

Get the number of members in a set (http://redis.io/commands/scard).

Subtract multiple sets (http://redis.io/commands/sdiff).

sdiffstoreSource

Arguments

:: ByteString

destination

-> [ByteString]

key

-> Redis (Either Reply Integer) 

Subtract multiple sets and store the resulting set in a key (http://redis.io/commands/sdiffstore).

Intersect multiple sets (http://redis.io/commands/sinter).

sinterstoreSource

Arguments

:: ByteString

destination

-> [ByteString]

key

-> Redis (Either Reply Integer) 

Intersect multiple sets and store the resulting set in a key (http://redis.io/commands/sinterstore).

Determine if a given value is a member of a set (http://redis.io/commands/sismember).

Get all the members in a set (http://redis.io/commands/smembers).

smoveSource

Arguments

:: ByteString

source

-> ByteString

destination

-> ByteString

member

-> Redis (Either Reply Bool) 

Move a member from one set to another (http://redis.io/commands/smove).

Remove and return a random member from a set (http://redis.io/commands/spop).

Get a random member from a set (http://redis.io/commands/srandmember).

sremSource

Arguments

:: ByteString

key

-> [ByteString]

member

-> Redis (Either Reply Integer) 

Remove one or more members from a set (http://redis.io/commands/srem).

Add multiple sets (http://redis.io/commands/sunion).

sunionstoreSource

Arguments

:: ByteString

destination

-> [ByteString]

key

-> Redis (Either Reply Integer) 

Add multiple sets and store the resulting set in a key (http://redis.io/commands/sunionstore).

Sorted Sets

zaddSource

Arguments

:: ByteString

key

-> [(Double, ByteString)]

scoreMember

-> Redis (Either Reply Integer) 

Add one or more members to a sorted set, or update its score if it already exists (http://redis.io/commands/zadd).

Get the number of members in a sorted set (http://redis.io/commands/zcard).

zcountSource

Arguments

:: ByteString

key

-> Double

min

-> Double

max

-> Redis (Either Reply Integer) 

Count the members in a sorted set with scores within the given values (http://redis.io/commands/zcount).

zincrbySource

Arguments

:: ByteString

key

-> Integer

increment

-> ByteString

member

-> Redis (Either Reply Double) 

Increment the score of a member in a sorted set (http://redis.io/commands/zincrby).

data Aggregate Source

Constructors

Sum 
Min 
Max 

zinterstoreSource

Arguments

:: ByteString

destination

-> [ByteString]

keys

-> Aggregate 
-> Redis (Either Reply Integer) 

Intersect multiple sorted sets and store the resulting sorted set in a new key (http://redis.io/commands/zinterstore). The Redis command ZINTERSTORE is split up into zinterstore, zinterstoreWeights.

zinterstoreWeightsSource

Arguments

:: ByteString

destination

-> [(ByteString, Double)]

weighted keys

-> Aggregate 
-> Redis (Either Reply Integer) 

Intersect multiple sorted sets and store the resulting sorted set in a new key (http://redis.io/commands/zinterstore). The Redis command ZINTERSTORE is split up into zinterstore, zinterstoreWeights.

zrangeSource

Arguments

:: ByteString

key

-> Integer

start

-> Integer

stop

-> Redis (Either Reply [ByteString]) 

Return a range of members in a sorted set, by index (http://redis.io/commands/zrange). The Redis command ZRANGE is split up into zrange, zrangeWithscores.

Return a range of members in a sorted set, by index (http://redis.io/commands/zrange). The Redis command ZRANGE is split up into zrange, zrangeWithscores.

Return a range of members in a sorted set, by score (http://redis.io/commands/zrangebyscore). The Redis command ZRANGEBYSCORE is split up into zrangebyscore, zrangebyscoreWithscores, zrangebyscoreLimit, zrangebyscoreWithscoresLimit.

Return a range of members in a sorted set, by score (http://redis.io/commands/zrangebyscore). The Redis command ZRANGEBYSCORE is split up into zrangebyscore, zrangebyscoreWithscores, zrangebyscoreLimit, zrangebyscoreWithscoresLimit.

zrangebyscoreLimitSource

Arguments

:: ByteString

key

-> Double

min

-> Double

max

-> Integer

offset

-> Integer

count

-> Redis (Either Reply [ByteString]) 

Return a range of members in a sorted set, by score (http://redis.io/commands/zrangebyscore). The Redis command ZRANGEBYSCORE is split up into zrangebyscore, zrangebyscoreWithscores, zrangebyscoreLimit, zrangebyscoreWithscoresLimit.

Return a range of members in a sorted set, by score (http://redis.io/commands/zrangebyscore). The Redis command ZRANGEBYSCORE is split up into zrangebyscore, zrangebyscoreWithscores, zrangebyscoreLimit, zrangebyscoreWithscoresLimit.

Determine the index of a member in a sorted set (http://redis.io/commands/zrank).

zremSource

Arguments

:: ByteString

key

-> [ByteString]

member

-> Redis (Either Reply Integer) 

Remove one or more members from a sorted set (http://redis.io/commands/zrem).

Remove all members in a sorted set within the given indexes (http://redis.io/commands/zremrangebyrank).

Remove all members in a sorted set within the given scores (http://redis.io/commands/zremrangebyscore).

zrevrangeSource

Arguments

:: ByteString

key

-> Integer

start

-> Integer

stop

-> Redis (Either Reply [ByteString]) 

Return a range of members in a sorted set, by index, with scores ordered from high to low (http://redis.io/commands/zrevrange). The Redis command ZREVRANGE is split up into zrevrange, zrevrangeWithscores.

Return a range of members in a sorted set, by index, with scores ordered from high to low (http://redis.io/commands/zrevrange). The Redis command ZREVRANGE is split up into zrevrange, zrevrangeWithscores.

Return a range of members in a sorted set, by score, with scores ordered from high to low (http://redis.io/commands/zrevrangebyscore). The Redis command ZREVRANGEBYSCORE is split up into zrevrangebyscore, zrevrangebyscoreWithscores, zrevrangebyscoreLimit, zrevrangebyscoreWithscoresLimit.

Return a range of members in a sorted set, by score, with scores ordered from high to low (http://redis.io/commands/zrevrangebyscore). The Redis command ZREVRANGEBYSCORE is split up into zrevrangebyscore, zrevrangebyscoreWithscores, zrevrangebyscoreLimit, zrevrangebyscoreWithscoresLimit.

zrevrangebyscoreLimitSource

Arguments

:: ByteString

key

-> Double

max

-> Double

min

-> Integer

offset

-> Integer

count

-> Redis (Either Reply [ByteString]) 

Return a range of members in a sorted set, by score, with scores ordered from high to low (http://redis.io/commands/zrevrangebyscore). The Redis command ZREVRANGEBYSCORE is split up into zrevrangebyscore, zrevrangebyscoreWithscores, zrevrangebyscoreLimit, zrevrangebyscoreWithscoresLimit.

Return a range of members in a sorted set, by score, with scores ordered from high to low (http://redis.io/commands/zrevrangebyscore). The Redis command ZREVRANGEBYSCORE is split up into zrevrangebyscore, zrevrangebyscoreWithscores, zrevrangebyscoreLimit, zrevrangebyscoreWithscoresLimit.

Determine the index of a member in a sorted set, with scores ordered from high to low (http://redis.io/commands/zrevrank).

Get the score associated with the given member in a sorted set (http://redis.io/commands/zscore).

zunionstoreSource

Arguments

:: ByteString

destination

-> [ByteString]

keys

-> Aggregate 
-> Redis (Either Reply Integer) 

Add multiple sorted sets and store the resulting sorted set in a new key (http://redis.io/commands/zunionstore). The Redis command ZUNIONSTORE is split up into zunionstore, zunionstoreWeights.

zunionstoreWeightsSource

Arguments

:: ByteString

destination

-> [(ByteString, Double)]

weighted keys

-> Aggregate 
-> Redis (Either Reply Integer) 

Add multiple sorted sets and store the resulting sorted set in a new key (http://redis.io/commands/zunionstore). The Redis command ZUNIONSTORE is split up into zunionstore, zunionstoreWeights.

Strings

Append a value to a key (http://redis.io/commands/append).

Decrement the integer value of a key by one (http://redis.io/commands/decr).

decrbySource

Arguments

:: ByteString

key

-> Integer

decrement

-> Redis (Either Reply Integer) 

Decrement the integer value of a key by the given number (http://redis.io/commands/decrby).

Get the value of a key (http://redis.io/commands/get).

getbitSource

Arguments

:: ByteString

key

-> Integer

offset

-> Redis (Either Reply Integer) 

Returns the bit value at offset in the string value stored at key (http://redis.io/commands/getbit).

Get a substring of the string stored at a key (http://redis.io/commands/getrange).

Set the string value of a key and return its old value (http://redis.io/commands/getset).

Increment the integer value of a key by one (http://redis.io/commands/incr).

incrbySource

Arguments

:: ByteString

key

-> Integer

increment

-> Redis (Either Reply Integer) 

Increment the integer value of a key by the given number (http://redis.io/commands/incrby).

Get the values of all the given keys (http://redis.io/commands/mget).

msetSource

Arguments

:: [(ByteString, ByteString)]

keyValue

-> Redis (Either Reply Status) 

Set multiple keys to multiple values (http://redis.io/commands/mset).

msetnxSource

Arguments

:: [(ByteString, ByteString)]

keyValue

-> Redis (Either Reply Bool) 

Set multiple keys to multiple values, only if none of the keys exist (http://redis.io/commands/msetnx).

setSource

Arguments

:: ByteString

key

-> ByteString

value

-> Redis (Either Reply Status) 

Set the string value of a key (http://redis.io/commands/set).

setbitSource

Arguments

:: ByteString

key

-> Integer

offset

-> ByteString

value

-> Redis (Either Reply Integer) 

Sets or clears the bit at offset in the string value stored at key (http://redis.io/commands/setbit).

setexSource

Arguments

:: ByteString

key

-> Integer

seconds

-> ByteString

value

-> Redis (Either Reply Status) 

Set the value and expiration of a key (http://redis.io/commands/setex).

setnxSource

Arguments

:: ByteString

key

-> ByteString

value

-> Redis (Either Reply Bool) 

Set the value of a key, only if the key does not exist (http://redis.io/commands/setnx).

setrangeSource

Arguments

:: ByteString

key

-> Integer

offset

-> ByteString

value

-> Redis (Either Reply Integer) 

Overwrite part of a string at key starting at the specified offset (http://redis.io/commands/setrange).

Get the length of the value stored in a key (http://redis.io/commands/strlen).

Transactions

Discard all commands issued after MULTI (http://redis.io/commands/discard).

Execute all commands issued after MULTI (http://redis.io/commands/exec).

Mark the start of a transaction block (http://redis.io/commands/multi).

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

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

Unimplemented Commands

These commands are not implemented, as of now. Library users can implement these or other commands from experimental Redis versions by using the sendRequest function.

Pub/Sub

publishSource

Arguments

:: ByteString

channel

-> ByteString

message

-> Redis (Either Reply Integer) 

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

pubSubSource

Arguments

:: PubSub

Initial subscriptions.

-> (Message -> IO PubSub)

Callback function.

-> Redis () 

Listens to published messages on subscribed channels.

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"]

data PubSub Source

Instances

subscribeSource

Arguments

:: [ByteString]

channel

-> PubSub 

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

unsubscribeSource

Arguments

:: [ByteString]

channel

-> PubSub 

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

psubscribeSource

Arguments

:: [ByteString]

pattern

-> PubSub 

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

punsubscribeSource

Arguments

:: [ByteString]

pattern

-> PubSub 

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

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]

data Reply Source

Low-level representation of replies from the Redis server.