def flush(ops = queue)
      operations, callbacks = ops.transpose
      logging(operations) do
        ensure_connected do |conn|
          conn.write(operations)
          replies = conn.receive_replies(operations)

          replies.zip(callbacks).map do |reply, callback|
            callback ? callback[reply] : reply
          end.last
        end
      end
    ensure
      ops.clear
    end
def flush(ops = queue)
      operations, callbacks = ops.transpose
      logging(operations) do
        ensure_connected do |conn|
          conn.write(operations)
          replies = conn.receive_replies(operations)

          replies.zip(callbacks).map do |reply, callback|
            callback ? callback[reply] : reply
          end.last
        end
      end
    ensure
      ops.clear
    end
Flush the node operations to the database.

 @api private

 @example Flush the operations.
   node.flush([ command ])

 @param [ Array<Message> ] ops The operations to flush.

 @return [ Object ] The result of the operations.

 @since 2.0.0