summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/spublish.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-04 07:19:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-04 07:19:32 +0000
commit7480e618ec785ba8a1c74c8a150cffe5880fb3bb (patch)
tree87422376dd9a7eee55850f0fce9a8bb4c13e44a2 /iredis/data/commands/spublish.md
parentAdding upstream version 1.12.1. (diff)
downloadiredis-7480e618ec785ba8a1c74c8a150cffe5880fb3bb.tar.xz
iredis-7480e618ec785ba8a1c74c8a150cffe5880fb3bb.zip
Adding upstream version 1.13.0.upstream/1.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/spublish.md')
-rw-r--r--iredis/data/commands/spublish.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/iredis/data/commands/spublish.md b/iredis/data/commands/spublish.md
new file mode 100644
index 0000000..e8b6925
--- /dev/null
+++ b/iredis/data/commands/spublish.md
@@ -0,0 +1,20 @@
+Posts a message to the given shard channel.
+
+In Redis Cluster, shard channels are assigned to slots by the same algorithm used to assign keys to slots.
+A shard message must be sent to a node that own the slot the shard channel is hashed to.
+The cluster makes sure that published shard messages are forwarded to all the node in the shard, so clients can subscribe to a shard channel by connecting to any one of the nodes in the shard.
+
+For more information about sharded pubsub, see [Sharded Pubsub](/topics/pubsub#sharded-pubsub).
+
+@return
+
+@integer-reply: the number of clients that received the message.
+
+@examples
+
+For example the following command publish to channel `orders` with a subscriber already waiting for message(s).
+
+```
+> spublish orders hello
+(integer) 1
+```