Method: Moped::Connection#write

Defined in:
lib/moped/connection.rb

#write(operations) ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Write to the connection.

Examples:

Write to the connection.

connection.write(data)

Parameters:

  • operations (Array<Message>)

    The database operations.

Returns:

  • (Integer)

    The number of bytes written.

Since:

  • 1.0.0



133
134
135
136
137
138
139
140
# File 'lib/moped/connection.rb', line 133

def write(operations)
  buf = ""
  operations.each do |operation|
    operation.request_id = (@request_id += 1)
    operation.serialize(buf)
  end
  @sock.write(buf)
end