Class: Monga::Protocol::GetMore

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

Constant Summary

Constants inherited from Request

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, #initialize, #parse_response, #perform

Constructor Details

This class inherits a constructor from Monga::Request

Instance Method Details

#bodyObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/monga/protocol/get_more.rb', line 5

def body
  @body ||= begin
    batch_size = @options[:batch_size] || 0
    cursor_id = @options[:cursor_id]

    msg = ::BinUtils.append_int32_le!(nil, 0)
    msg << full_name << Monga::NULL_BYTE
    ::BinUtils.append_int32_le!(msg, batch_size)
    ::BinUtils.append_int64_le!(msg, cursor_id)
    msg
  end
end