def METHOD_NAME(message_iter):
    it = iter(message_iter)
    if paused:  # equivalent to ``paused or output``
        append(it)
        return
    for message in it:
        _write_message(message)
        if paused:
            append(it)
            return