Sha256: cb91a53e77f66c1d227333c6324d10e391c75697ce79f1fa4b6d3dfce0f9a191

Contents?: true

Size: 1.58 KB

Versions: 49

Compression:

Stored size: 1.58 KB

Contents

module Moped
  module Protocol

    # The Protocol class for killing active cursors.
    #
    # @example
    #   command = KillCursors.new [123, 124, 125]
    #
    # @example Setting the request id
    #   command = KillCursors.new [123, 124, 125], request_id: 456
    class KillCursors
      include Message

      # @attribute
      # @return [Number] the length of the message
      int32 :length

      # @attribute
      # @return [Number] the request id of the message
      int32 :request_id

      int32 :response_to

      # @attribute
      # @return [Number] the operation code of this message
      int32 :op_code

      int32    :reserved # reserved for future use

      # @attribute
      # @return [Number] the number of cursor ids
      int32    :number_of_cursor_ids

      # @attribute
      # @return [Array] the cursor ids to kill
      int64    :cursor_ids, type: :array

      finalize

      undef op_code
      # @return [Number] OP_KILL_CURSORS operation code (2007)
      def op_code
        2007
      end

      # Create a new command to kill cursors.
      #
      # @param [Array] cursor_ids an array of cursor ids to kill
      # @param [Hash] options additional options
      # @option options [Number] :request_id the command's request id
      def initialize(cursor_ids, options = {})
        @cursor_ids           = cursor_ids
        @number_of_cursor_ids = cursor_ids.length
        @request_id           = options[:request_id]
      end

      def log_inspect
        type = "KILL_CURSORS"

        "%-12s cursor_ids=%s" % [type, cursor_ids.inspect]
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/bundler/gems/moped-cf817ca58a85/lib/moped/protocol/kill_cursors.rb
moped-2.0.7 lib/moped/protocol/kill_cursors.rb
moped-2.0.6 lib/moped/protocol/kill_cursors.rb
moped-1.5.3 lib/moped/protocol/kill_cursors.rb
moped-2.0.5 lib/moped/protocol/kill_cursors.rb
moped-2.0.4 lib/moped/protocol/kill_cursors.rb
moped-2.0.3 lib/moped/protocol/kill_cursors.rb
moped-2.0.2 lib/moped/protocol/kill_cursors.rb
moped-2.0.1 lib/moped/protocol/kill_cursors.rb
moped-2.0.0 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.rc2 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.rc1 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.beta6 lib/moped/protocol/kill_cursors.rb
moped-1.5.2 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.beta5 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.beta4 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.beta3 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.beta2 lib/moped/protocol/kill_cursors.rb
moped-2.0.0.beta lib/moped/protocol/kill_cursors.rb
moped-1.5.1 lib/moped/protocol/kill_cursors.rb