Method: EM::Mongo::EMConnection#send_command

Defined in:
lib/em-mongo/connection.rb

#send_command(op, message, options = {}, &cb) ⇒ Object



99
100
101
102
103
104
105
106
107
108
# File 'lib/em-mongo/connection.rb', line 99

def send_command(op, message, options={}, &cb)
  request_id, buffer = prepare_message(op, message, options)

  callback do
    send_data buffer
  end

  @responses[request_id] = cb if cb
  request_id
end