5.3.3 <al-flush>
Description: <al-flush>
Keywords: albatross

##
5.3.3 `<al-flush>`

When the template file interpreter encounters an `<al-flush>` during execution it flushes all accumulated HTML to output.

Usually HTML is accumulated in the execution context and is not sent to the output until the `flush_content()` is called. This gives programs the opportunity to handle exceptions encountered during template execution without partial output leaking to the browser.

When the program is performing an operation that runs for some time this behaviour may give user the impression that the application has entered an infinite loop. In these cases it is usually a good idea to provide incremental feedback to the user by placing `<al-flush>` tags in your template files.

    >>> import albatross
    >>> ctx = albatross.SimpleContext('.')
    >>> albatross.Template(ctx, '<magic>', '''
    ... Processing results...
    ... <al-flush>
    ... Finished
    ... ''').to_html(ctx)
    Processing results...
    >>> ctx.flush_content()
    Finished