Class: Monga::Protocol::KillCursors

Inherits:
Request
  • Object
show all
Defined in:
lib/monga/protocol/kill_cursors.rb

Constant Summary

Constants inherited from Request

Request::FLAGS, Request::OP_CODES

Instance Attribute Summary

Attributes inherited from Request

#connection, #request_id

Instance Method Summary collapse

Methods inherited from Request

#callback_perform, #command, #header, #parse_response, #perform

Constructor Details

#initialize(connection, options = {}) ⇒ KillCursors

Returns a new instance of KillCursors.



5
6
7
8
9
# File 'lib/monga/protocol/kill_cursors.rb', line 5

def initialize(connection, options = {})
  @options = options
  @request_id = self.class.request_id
  @connection = connection
end

Instance Method Details

#bodyObject



11
12
13
14
15
16
17
18
19
# File 'lib/monga/protocol/kill_cursors.rb', line 11

def body
  @body ||= begin
    cursor_ids = @options[:cursor_ids]

    msg = ::BinUtils.append_int32_le!(nil, 0, cursor_ids.size)
    ::BinUtils.append_int64_le!(msg, 0, *cursor_ids)
    msg
  end
end