@@ -6,11 +6,19 @@ module Commands
66 # Pub/Sub is not yet supported and is partially implemented.
77 # Use at your own risks.
88 #
9+ # @api experimental
10+ # @note EXPERIMENTAL: the entire Pub/Sub surface is subject to change and
11+ # is not covered by semantic versioning.
12+ #
913 # @see https://valkey.io/commands/#pubsub
1014 #
1115 module PubSubCommands
1216 # Subscribe to one or more channels.
1317 #
18+ # @api experimental
19+ # @note EXPERIMENTAL and withheld: private for 1.0.0 because the message
20+ # delivery path is incomplete. Calling this raises NoMethodError.
21+ #
1422 # @param [Array<String>] channels the channels to subscribe to
1523 # @return [String] "OK"
1624 #
@@ -21,6 +29,10 @@ def subscribe(*channels)
2129
2230 # Unsubscribe from one or more channels.
2331 #
32+ # @api experimental
33+ # @note EXPERIMENTAL and withheld: private for 1.0.0 because the message
34+ # delivery path is incomplete. Calling this raises NoMethodError.
35+ #
2436 # @param [Array<String>] channels the channels to unsubscribe from (empty for all)
2537 # @return [String] "OK"
2638 #
@@ -31,6 +43,10 @@ def unsubscribe(*channels)
3143
3244 # Subscribe to one or more patterns.
3345 #
46+ # @api experimental
47+ # @note EXPERIMENTAL and withheld: private for 1.0.0 because the message
48+ # delivery path is incomplete. Calling this raises NoMethodError.
49+ #
3450 # @param [Array<String>] patterns the patterns to subscribe to
3551 # @return [String] "OK"
3652 #
@@ -41,6 +57,10 @@ def psubscribe(*patterns)
4157
4258 # Unsubscribe from one or more patterns.
4359 #
60+ # @api experimental
61+ # @note EXPERIMENTAL and withheld: private for 1.0.0 because the message
62+ # delivery path is incomplete. Calling this raises NoMethodError.
63+ #
4464 # @param [Array<String>] patterns the patterns to unsubscribe from (empty for all)
4565 # @return [String] "OK"
4666 #
@@ -51,6 +71,10 @@ def punsubscribe(*patterns)
5171
5272 # Publish a message to a channel.
5373 #
74+ # @api experimental
75+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
76+ # not covered by semantic versioning; may change in a future minor.
77+ #
5478 # @example Publish a message
5579 # valkey.publish("channel1", "Hello, World!")
5680 # # => 2
@@ -66,6 +90,10 @@ def publish(channel, message)
6690
6791 # Subscribe to one or more shard channels.
6892 #
93+ # @api experimental
94+ # @note EXPERIMENTAL and withheld: private for 1.0.0 because the message
95+ # delivery path is incomplete. Calling this raises NoMethodError.
96+ #
6997 # @param [Array<String>] channels the shard channels to subscribe to
7098 # @return [String] "OK"
7199 #
@@ -76,6 +104,10 @@ def ssubscribe(*channels)
76104
77105 # Unsubscribe from one or more shard channels.
78106 #
107+ # @api experimental
108+ # @note EXPERIMENTAL and withheld: private for 1.0.0 because the message
109+ # delivery path is incomplete. Calling this raises NoMethodError.
110+ #
79111 # @param [Array<String>] channels the shard channels to unsubscribe from (empty for all)
80112 # @return [String] "OK"
81113 #
@@ -86,6 +118,10 @@ def sunsubscribe(*channels)
86118
87119 # Publish a message to a shard channel.
88120 #
121+ # @api experimental
122+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
123+ # not covered by semantic versioning; may change in a future minor.
124+ #
89125 # @example Publish a message to a shard channel
90126 # valkey.spublish("shard1", "Hello, Shard!")
91127 # # => 1
@@ -101,6 +137,10 @@ def spublish(channel, message)
101137
102138 # List active channels.
103139 #
140+ # @api experimental
141+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
142+ # not covered by semantic versioning; may change in a future minor.
143+ #
104144 # @example List all active channels
105145 # valkey.pubsub_channels
106146 # # => ["channel1", "channel2"]
@@ -119,6 +159,10 @@ def pubsub_channels(pattern = nil)
119159
120160 # Get the number of unique patterns subscribed to.
121161 #
162+ # @api experimental
163+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
164+ # not covered by semantic versioning; may change in a future minor.
165+ #
122166 # @example Get pattern count
123167 # valkey.pubsub_numpat
124168 # # => 3
@@ -132,6 +176,10 @@ def pubsub_numpat
132176
133177 # Get the number of subscribers for channels.
134178 #
179+ # @api experimental
180+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
181+ # not covered by semantic versioning; may change in a future minor.
182+ #
135183 # @example Get subscriber counts
136184 # valkey.pubsub_numsub("channel1", "channel2")
137185 # # => ["channel1", 5, "channel2", 3]
@@ -146,6 +194,10 @@ def pubsub_numsub(*channels)
146194
147195 # List active shard channels.
148196 #
197+ # @api experimental
198+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
199+ # not covered by semantic versioning; may change in a future minor.
200+ #
149201 # @example List all active shard channels
150202 # valkey.pubsub_shardchannels
151203 # # => ["shard1", "shard2"]
@@ -164,6 +216,10 @@ def pubsub_shardchannels(pattern = nil)
164216
165217 # Get the number of subscribers for shard channels.
166218 #
219+ # @api experimental
220+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
221+ # not covered by semantic versioning; may change in a future minor.
222+ #
167223 # @example Get shard subscriber counts
168224 # valkey.pubsub_shardnumsub("shard1", "shard2")
169225 # # => ["shard1", 2, "shard2", 1]
@@ -178,6 +234,12 @@ def pubsub_shardnumsub(*channels)
178234
179235 # Control pub/sub operations (convenience method).
180236 #
237+ # @api experimental
238+ # @note EXPERIMENTAL: usable today, but part of the Pub/Sub surface and
239+ # not covered by semantic versioning; may change in a future minor.
240+ # Only the introspection subcommands are reachable - `channels`,
241+ # `numpat`, `numsub`, `shardchannels`, `shardnumsub`.
242+ #
181243 # @example List active channels
182244 # valkey.pubsub(:channels)
183245 # # => ["channel1", "channel2"]
0 commit comments