Output data like WP’s plugin installer/updater

Yes, WordPress uses output buffering for displaying these messages. There’s a nifty function you can use within your loop called show_message() which utilizes wp_ob_end_flush_all();

function show_message($message) {
    if ( is_wp_error($message) ){
        if ( $message->get_error_data() )
            $message = $message->get_error_message() . ': ' . $message->get_error_data();
        else
            $message = $message->get_error_message();
    }
    echo "<p>$message</p>\n";
    wp_ob_end_flush_all();
    flush();
}

You might wish to abstract this to your own function as there is a feature in the queue to migrate this to a method within WP_Error. It’s possible this function will become deprecated in the future.

error code: 523