File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2000,6 +2000,20 @@ def punsubscribe(*channels)
2000
2000
end
2001
2001
end
2002
2002
2003
+ # redis.pubsub(:channels, '*')
2004
+ # # => ['channel-1', 'channel-2']
2005
+ # redis.pubsub(:numsub, 'channel-1', 'channel-2')
2006
+ # # => ['channel-1', 23, 'channel-2', 11]
2007
+ # redis.pubsub(:numpat)
2008
+ # # => 3
2009
+ # Inspect the state of the Pub/Sub subsystem.
2010
+ # Possible subcommands: channels, numsub, numpat.
2011
+ def pubsub ( subcommand , *args )
2012
+ synchronize do |client |
2013
+ client . call ( [ :pubsub , subcommand , args ] . flatten )
2014
+ end
2015
+ end
2016
+
2003
2017
# Watch the given keys to determine execution of the MULTI/EXEC block.
2004
2018
#
2005
2019
# Using a block is optional, but is necessary for thread-safety.
You can’t perform that action at this time.
0 commit comments