summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/client-setname.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-21 10:28:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:16:53 +0000
commit06cba6ccd165ca8b224797e37fccb9e63f026d77 (patch)
treee82f1bc439997ae296f2e74f8a64d84c5d95f140 /iredis/data/commands/client-setname.md
parentInitial commit. (diff)
downloadiredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.tar.xz
iredis-06cba6ccd165ca8b224797e37fccb9e63f026d77.zip
Adding upstream version 1.9.1.upstream/1.9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/client-setname.md')
-rw-r--r--iredis/data/commands/client-setname.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/iredis/data/commands/client-setname.md b/iredis/data/commands/client-setname.md
new file mode 100644
index 0000000..0155a42
--- /dev/null
+++ b/iredis/data/commands/client-setname.md
@@ -0,0 +1,28 @@
+The `CLIENT SETNAME` command assigns a name to the current connection.
+
+The assigned name is displayed in the output of `CLIENT LIST` so that it is
+possible to identify the client that performed a given connection.
+
+For instance when Redis is used in order to implement a queue, producers and
+consumers of messages may want to set the name of the connection according to
+their role.
+
+There is no limit to the length of the name that can be assigned if not the
+usual limits of the Redis string type (512 MB). However it is not possible to
+use spaces in the connection name as this would violate the format of the
+`CLIENT LIST` reply.
+
+It is possible to entirely remove the connection name setting it to the empty
+string, that is not a valid connection name since it serves to this specific
+purpose.
+
+The connection name can be inspected using `CLIENT GETNAME`.
+
+Every new connection starts without an assigned name.
+
+Tip: setting names to connections is a good way to debug connection leaks due to
+bugs in the application using Redis.
+
+@return
+
+@simple-string-reply: `OK` if the connection name was successfully set.