Sha256: 52c33e51f7a095e1e24bb5adb8646d845c6d3d5fcb4b7887b622fd04071ebef7

Contents?: true

Size: 885 Bytes

Versions: 2

Compression:

Stored size: 885 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2023, by Nick Burwell.

module Protocol
  module Redis
    module Methods
      module Cluster
        # Sends the `CLUSTER *` command to random node and returns its reply.
        # @see https://redis.io/commands/cluster-addslots/
        # @param subcommand [String, Symbol] the subcommand of cluster command
        #   e.g. `:addslots`, `:delslots`, `:nodes`, `:replicas`, `:info`
        #
        # @return [Object] depends on the subcommand provided
        def cluster(subcommand, *args)
          call("CLUSTER", subcommand.to_s, *args)
        end

        # Sends `ASKING` command to random node and returns its reply.
        # @see https://redis.io/commands/asking/
        #
        # @return [String] `'OK'`
        def asking
          call("ASKING")
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
protocol-redis-0.8.1 lib/protocol/redis/methods/cluster.rb
protocol-redis-0.8.0 lib/protocol/redis/methods/cluster.rb