CLIENT
Since 1.1.0Server
Syntax
CLIENTCLIENT is a container: the work is done by its subcommands, which look at and manage the connections to the server, the one sending them included.
| Subcommand | |
|---|---|
CLIENT ID, CLIENT INFO, CLIENT LIST | who is connected, and what each connection is doing |
CLIENT SETNAME, CLIENT GETNAME, CLIENT SETINFO | label a connection, so that it can be found in CLIENT LIST |
CLIENT KILL, CLIENT UNBLOCK | close a connection, or end its blocking command |
CLIENT PAUSE, CLIENT UNPAUSE | hold every client's commands, or just writes, for a while |
CLIENT REPLY | turn off the replies to this connection |
CLIENT TRACKING, CLIENT CACHING, CLIENT TRACKINGINFO, CLIENT GETREDIR | client-side caching |
CLIENT NO-EVICT, CLIENT NO-TOUCH | accepted for compatibility |
CLIENT HELP | the list, from the server |
CLIENT alone, or with a name that is not one of these, is an error.
Examples
> CLIENT
(error) ERR wrong number of arguments for 'client' command
> CLIENT NOPE
(error) ERR unknown subcommand 'NOPE'. Try CLIENT HELP.
Subcommands
- CLIENT CACHING: CLIENT CACHING yes makes the next read of an OPTIN connection be remembered; CLIENT CACHING no makes the next read of an OPTOUT one be skipped.
- CLIENT GETNAME: Returns the name the connection was given with CLIENT SETNAME, or nil when it has none.
- CLIENT GETREDIR: Returns the ID of the connection this one's client-side caching invalidations go to, as set with REDIRECT in CLIENT TRACKING.
- CLIENT HELP: Lists the CLIENT subcommands, one line each with its arguments, followed by an indented line saying what it does.
- CLIENT ID: Returns the connection's ID.
- CLIENT INFO: Returns this connection's line of CLIENT LIST: its ID, address, name, database, the last command it ran, its user, its protocol (resp=2 or resp=3), the library it reported with CLIENT SETINFO, and it…
- CLIENT KILL: Closes connections.
- CLIENT LIST: Returns a line per connection, with Redis's fields: id, addr, laddr, name, age, idle, flags, db, sub, psub, ssub, multi, watch, cmd, user, redir, resp, lib-name, lib-ver and others.
- CLIENT NO-EVICT: Accepted for compatibility, and changes nothing.
- CLIENT NO-TOUCH: Accepted for compatibility, and changes nothing.
- CLIENT PAUSE: Holds clients' commands for timeout milliseconds, or until CLIENT UNPAUSE.
- CLIENT REPLY: Turns off the server's replies to this connection, to send a stream of commands without reading anything back.
- CLIENT SETINFO: Records the client library's name, LIB-NAME, or version, LIB-VER, on the connection; CLIENT LIST and CLIENT INFO show them as lib-name and lib-ver.
- CLIENT SETNAME: Names the connection; the name shows in CLIENT LIST.
- CLIENT TRACKING: Turns client-side caching on or off for this connection.
- CLIENT TRACKINGINFO: Returns this connection's client-side caching state, as set with CLIENT TRACKING.
- CLIENT UNBLOCK: Ends the blocking command another connection is waiting in, such as BLPOP, BLMOVE, BZPOPMIN or XREAD BLOCK, as if its timeout had passed, or with an error.
- CLIENT UNPAUSE: Ends a CLIENT PAUSE at once, whether it held every command or just writes, and releases the commands it held: each runs, in the order it arrived, and gets its reply.