def write(operations)
      buf = ""
      operations.each do |operation|
        operation.request_id = (@request_id += 1)
        operation.serialize(buf)
      end
      with_connection do |socket|
        socket.write(buf)
      end
    end
def write(operations)
      buf = ""
      operations.each do |operation|
        operation.request_id = (@request_id += 1)
        operation.serialize(buf)
      end
      with_connection do |socket|
        socket.write(buf)
      end
    end
Write to the connection.

 @example Write to the connection.
   connection.write(data)

 @param [ Array<Message> ] operations The database operations.

 @return [ Integer ] The number of bytes written.

 @since 1.0.0