Common Lisp Package: LREDIS

README:

FUNCTION

Public

APPEND (KEY VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Append the specified string to the string stored at key.

AUTH (PASSWORD &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Simple password authentication if enabled.

BGREWRITEAOF (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Rewrite the append only file in the background when it gets too big.

BGSAVE (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Asynchronously save the database on disk.

BLPOP (KEYS TIMEOUT &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Blocking LPOP

BRPOP (KEYS TIMEOUT &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Blocking RPOP

CONFIG (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Configure a redis server at runtime.

DBSIZE (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the number of keys in the current database.

DECR (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Decrement the integer value of key.

DECRBY (KEY INTEGER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Decrement the integer value of key by integer.

DEL (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Delete a key.

DISCARD (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Rollback transaction

EXEC (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Commit transaction

EXISTS (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Test if a key exists.

EXPIRE (KEY SECONDS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Expire key in a number of seconds from now.

FLUSHALL (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove all the keys from all the databases.

FLUSHDB (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove all the keys of the currently selected database.

GET (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the string value of the key.

GETSET (KEY VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set a key to a string returning the old value of the key.

HDEL (KEY FIELD &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove the specified field from a hash.

HEXISTS (KEY FIELD &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Test for existence of a specified field in a hash.

HGET (KEY FIELD &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Retrieve the value of the specified hash field.

HGETALL (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return all the fields and associated values in a hash.

HINCRBY (KEY FIELD INTEGER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Increment the integer value of the hash at key on field with integer.

HKEYS (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return all the fields in a hash.

HLEN (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the number of items in a hash.

HMSET (KEY FIELDS/VALS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set the hash fields to their respective values.

HSET (KEY FIELD VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set the hash field to the specified value. Creates the hash if needed.

HSETNX (KEY FIELD VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set the hash field to the specified value, if the field does not exist. Creates the hash if needed.

HVALS (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return all the values in a hash.

INCR (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Increment the integer value of key.

INCRBY (KEY INTEGER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Increment the integer value of key by integer.

INFO (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Provide information and statistics about the server

KEYS (PATTERN &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return all the keys matching a given pattern.

LASTSAVE (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the UNIX timestamp of the last successful save.

LINDEX (KEY INDEX &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the element at index position from the list at key.

LLEN (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the length of the list value at key.

LPOP (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return and remove (atomically) the first element of the list at key.

LPUSH (KEY VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Append an element to the head of the list value at key.

LRANGE (KEY START END &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return a range of elements from the list at key.

LREM (KEY COUNT VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove the first-N, last-N, or all the elements matching value from the list at key.

LSET (KEY INDEX VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set a new value as the element at index position of the list at key.

LTRIM (KEY START END &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Trim the list at key to the specified range of elements.

MGET (KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Multi-get, return the string values of the keys.

MOVE (KEY DBINDEX &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Move the key from the currently selected database to a database specified by index.

MSET (KEYS/VALS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set multiple keys to multiple values in a single atomic operation.

MSETNX (KEYS/VALS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set multiple keys to multiple values in a single atomic operation if none of the keys already exist.

MULTI (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Begin a transaction

PING (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Ping the redis server.

PUBLISH (CHANNEL MESSAGE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Post a message to a given channel.

PUBSUB-DISPATCH (&KEY (CONNECTION *CONNECTION*))

Wait for a publisher/subscriber event from Redis and dispatch appropriately. There's no notification about subscriptions or unsubscriptions, but we return true if any subscriptions are still active and false otherwise.

QUIT (&KEY (CONNECTION *CONNECTION*))

Close the connection.

RANDOMKEY (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return a random key from the key space.

RENAME (OLDNAME NEWNAME &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Rename the old key to the new one, superseding any existing key.

RENAMENX (OLDNAME NEWNAME &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Rename the old key to the new one unless a key with the new name already exists.

RPOP (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return and remove (atomically) the last element of the list at key.

RPOPLPUSH (SRCKEY DSTKEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return and remove (atomically) the last element of the source list stored at srckey and push the same element to the destination list stored at dstkey

RPUSH (KEY VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Append an element to the tail of the list value at key.

SADD (KEY MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Add the specified member to the set value at key.

SAVE (&KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Synchronously save the database on disk.

SCARD (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the number of elements (the cardinality) of the set at key.

SDIFF (KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the difference between the set stored at the first key and the sets stored at the rest of the keys.

SDIFFSTORE (DSTKEY KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Compute the difference between the set stored at the first key and the sets stored at the rest of the keys, and store it at dstkey.

SELECT (INDEX &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Select the database having the specified index.

SET (KEY VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set a key to a string value.

SETEX (KEY TIME VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set+Expire combo command

SETNX (KEY VALUE &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Set a key to a string value if the key does not exist.

SHUTDOWN (&KEY (CONNECTION *CONNECTION*))

Synchronously save the database on disk, then shutdown the server.

SINTER (KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the intersection of the sets stored at keys.

SINTERSTORE (DSTKEY KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Compute the intersection of the sets stored at keys and store the resulting set at dstkey.

SISMEMBER (KEY MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Test if the specified value is a member of the set at key.

SLAVEOF (HOST PORT &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Change the replication settings.

SMEMBERS (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return all the members of the set value at key.

SMOVE (SRCKEY DSTKEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Move the specified member from one set to another atomically.

SORT (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL) ORDER (LIMIT-START 0) LIMIT-END BY GET ALPHA)

Sort a set or a list according to the specified parameters.

SPOP (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove and return (pop) a random element from the set value at key.

SRANDMEMBER (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return a random member of the set value at key.

SREM (KEY MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove the specified member from the set value at key.

SUBSCRIBE (FUNCTION &KEY (CONNECTION *CONNECTION*) (WANT-OCTETS NIL) (CHANNELS 'NIL) (PATTERNS 'NIL))

Subscribe the client to the specified channels or patterns, calling the function when a relevant event is available. The function should take two arguments: the originating channel and the actual message.

SUBSTR (KEY START END &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return a substring out of a larger string.

SUNION (KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the union of the sets stored at keys.

SUNIONSTORE (DSTKEY KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Compute the union of the sets stored at keys and store the resulting set at dstkey.

TTL (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Get the number of seconds from now until expiry.

TYPE (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the type of the value stored at key.

UNSUBSCRIBE (&KEY (CHANNELS 'NIL) (PATTERNS 'NIL) (CONNECTION *CONNECTION*))

Unsubscribe the client from the specified channels or patterns. In order to unsubscribe from all channels or patterns, pass :ALL as an argument.

ZADD (KEY SCORE MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Add the specified member to the sorted set value at key or update the score if it already exists.

ZCARD (KEY &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the number of elements (cardinality) of the sorted set at key.

ZINCRBY (KEY INCREMENT MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

If the member already exists, increment its score by increment, otherwise add the member setting increment as score.

ZINTERSTORE (DSTKEY N KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL) WEIGHTS AGGREGATE)

Intersect over a number of sorted sets with optional weight and aggregate.

ZRANGE (KEY START END &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return a range of elements from the sorted set at key, ordered by smallest to greatest score.

ZRANGEBYSCORE (KEY MIN MAX &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return all the elements with min <= score <= max (a range query) from the sorted set.

ZRANK (KEY MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the rank (or index) of member in the sorted set at key, with scores being oredered from low to high.

ZREM (KEY MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove the specified member from the sorted set value at key.

ZREMRANGEBYRANK (KEY MIN MAX &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove all the elements with min <= rank <= max rank from the sorted set.

ZREMRANGEBYSCORE (KEY MIN MAX &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Remove all the elements with min <= score <= max score from the sorted set.

ZREVRANGE (KEY START END &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return a range of elements from the sorted set at key, ordered by greatest to the smallest score.

ZREVRANK (KEY MEMBER &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the rank (or index) of member in the sorted set at key, with scores being ordered from high to low.

ZSCORE (KEY ELEMENT &KEY (CONNECTION *CONNECTION*) (OCTETS NIL))

Return the score associated with the specified element of the sorted set at key.

ZUNIONSTORE (DSTKEY N KEYS &KEY (CONNECTION *CONNECTION*) (OCTETS NIL) WEIGHTS AGGREGATE)

Union over a number of sorted sets with optional weight and aggregate.

Undocumented

CLOSE-CONNECTION (CONNECTION)

OPEN-CONNECTION (&OPTIONAL HOST PORT)

Private

%PSUBSCRIBE (PATTERNS &KEY (CONNECTION *CONNECTION*))

Subscribe the client to the given patterns.

%PUNSUBSCRIBE (PATTERNS &KEY (CONNECTION *CONNECTION*))

Unsubscribe the client from the given patterns.

%SUBSCRIBE (CHANNELS &KEY (CONNECTION *CONNECTION*))

Subscribe the client to the specified channels.

%UNSUBSCRIBE (CHANNELS &KEY (CONNECTION *CONNECTION*))

Unsubscribe the client from the given channels, or from all of them if none is given.

SOCKET-CONNECT (HOST PORT &KEY (PROTOCOL STREAM) (ELEMENT-TYPE 'CHARACTER) TIMEOUT DEADLINE (NODELAY T NODELAY-SPECIFIED) LOCAL-HOST LOCAL-PORT &AUX (SOCKOPT-TCP-NODELAY-P (FBOUNDP 'SOCKOPT-TCP-NODELAY)))

Connect to `host' on `port'. `host' is assumed to be a string or an IP address represented in vector notation, such as #(192 168 1 1). `port' is assumed to be an integer. `element-type' specifies the element type to use when constructing the stream associated with the socket. The default is 'character. `nodelay' Allows to disable/enable Nagle's algorithm (http://en.wikipedia.org/wiki/Nagle%27s_algorithm). If this parameter is omitted, the behaviour is inherited from the CL implementation (in most cases, Nagle's algorithm is enabled by default, but for example in ACL it is disabled). If the parmeter is specified, one of these three values is possible: T - Disable Nagle's algorithm; signals an UNSUPPORTED condition if the implementation does not support explicit manipulation with that option. NIL - Leave Nagle's algorithm enabled on the socket; signals an UNSUPPORTED condition if the implementation does not support explicit manipulation with that option. :IF-SUPPORTED - Disables Nagle's algorithm if the implementation allows this, otherwises just ignore this option. Returns a usocket object.

Undocumented

CONNECTION-STREAM (CONNECTION)

KEY-SEQUENCE (KEY)

OCTETS-TO-STRING (VECTOR &KEY (START 0) END (ERRORP (NOT *SUPPRESS-CHARACTER-CODING-ERRORS*)) (ENCODING *DEFAULT-CHARACTER-ENCODING*))

READ-DELIMITED-BYTES (STREAM)

READ-REPLY (CONNECTION)

STRING-TO-OCTETS (STRING &KEY (ENCODING *DEFAULT-CHARACTER-ENCODING*) (START 0) END (USE-BOM DEFAULT) (ERRORP (NOT *SUPPRESS-CHARACTER-CODING-ERRORS*)))

TRANSLATE-EVENT (EVENT)

TRANSLATE-RESULT (RESULT WANT-OCTETS BOOLEANIZE)

WRITE-MULTI-BULK (SEQUENCES N OUT)

MACRO

Public

Undocumented

WITH-CONNECTION ((&KEY CONNECTION HOST PORT) &BODY FORMS)

Private

WITH-OUTPUT-TO-SEQUENCE ((VAR &KEY (RETURN-AS ''VECTOR) (ELEMENT-TYPE ''DEFAULT) (EXTERNAL-FORMAT '*DEFAULT-CHARACTER-ENCODING*) INITIAL-BUFFER-SIZE) &BODY BODY)

Creates an IN-MEMORY output stream, binds VAR to this stream and then executes the code in BODY. The stream stores data of type ELEMENT-TYPE (a subtype of OCTET). The stream is automatically closed on exit from WITH-OUTPUT-TO-SEQUENCE, no matter whether the exit is normal or abnormal. The return value of this macro is a vector (or a list if AS-LIST is true) containing the octets that were sent to the stream within BODY.

Undocumented

DEFINE-COMMAND (NAME &REST SPEC)

GENERIC-FUNCTION

Public

Undocumented

PUBSUB-BAD-EVENT-EVENT (CONDITION)

TEXT (CONDITION)

SETFTEXT (NEW-VALUE CONDITION)

Private

SOCKET-CLOSE (USOCKET)

Close a previously opened `usocket'.

SLOT-ACCESSOR

Private

SOCKET-STREAM (OBJECT)

Stream instance associated with the socket.

SETFSOCKET-STREAM (NEW-VALUE OBJECT)

Stream instance associated with the socket.

Undocumented

CONNECTION-CHANNEL-SUBSCRIPTIONS (OBJECT)

SETFCONNECTION-CHANNEL-SUBSCRIPTIONS (NEW-VALUE OBJECT)

CONNECTION-PATTERN-SUBSCRIPTIONS (OBJECT)

SETFCONNECTION-PATTERN-SUBSCRIPTIONS (NEW-VALUE OBJECT)

CONNECTION-SOCKET (OBJECT)

SETFCONNECTION-SOCKET (NEW-VALUE OBJECT)

SUBSCRIPTION-FUNCTION (OBJECT)

SUBSCRIPTION-WANT-OCTETS (OBJECT)

VARIABLE

Public

Undocumented

*HOST*

*PORT*

CLASS

Private

Undocumented

CONNECTION

SUBSCRIPTION

CONDITION

Public

Undocumented

PUBSUB-BAD-EVENT

PUBSUB-SPAM

REDIS-ERROR