class Moped::Protocol::KillCursors

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

Public Class Methods

new(cursor_ids, options = {}) click to toggle source

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

# File lib/moped/protocol/kill_cursors.rb, line 51
def initialize(cursor_ids, options = {})
  @cursor_ids           = cursor_ids
  @number_of_cursor_ids = cursor_ids.length
  @request_id           = options[:request_id]
end

Public Instance Methods

log_inspect() click to toggle source
# File lib/moped/protocol/kill_cursors.rb, line 57
def log_inspect
  type = "KILL_CURSORS"

  "%-12s cursor_ids=%s" % [type, cursor_ids.inspect]
end
op_code() click to toggle source

@return [Number] OP_KILL_CURSORS operation code (2007)

# File lib/moped/protocol/kill_cursors.rb, line 42
def op_code
  2007
end