Module: Redis::Commands::Cluster
- Included in:
- Redis::Commands
- Defined in:
- lib/redis/commands/cluster.rb
Instance Method Summary collapse
-
#asking ⇒ String
Sends ‘ASKING` command to random node and returns its reply.
-
#cluster(subcommand, *args) ⇒ Object
Sends ‘CLUSTER *` command to random node and returns its reply.
Instance Method Details
#asking ⇒ String
Sends ‘ASKING` command to random node and returns its reply.
40 41 42 |
# File 'lib/redis/commands/cluster.rb', line 40 def asking send_command(%i[asking]) end |
#cluster(subcommand, *args) ⇒ Object
Sends ‘CLUSTER *` command to random node and returns its reply.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/redis/commands/cluster.rb', line 14 def cluster(subcommand, *args) subcommand = subcommand.to_s.downcase block = case subcommand when 'slots' HashifyClusterSlots when 'nodes' HashifyClusterNodes when 'slaves' HashifyClusterSlaves when 'info' HashifyInfo else Noop end # @see https://github.com/antirez/redis/blob/unstable/src/redis-trib.rb#L127 raw reply expected block = Noop unless @cluster_mode send_command([:cluster, subcommand] + args, &block) end |