# man > Data::Stream::Bulk::DoneFlag(3pm)

## NAME
    [Data::Stream::Bulk::DoneFlag](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AStream%3A%3ABulk%3A%3ADoneFlag/markdown) - Implement the "is_done" method in terms of a flag

## VERSION
    version 0.11

## SYNOPSIS
            package [Data::Stream::Bulk::Blah](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AStream%3A%3ABulk%3A%3ABlah/markdown);
            use Moose;

            with qw([Data::Stream::Bulk::DoneFlag](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AStream%3A%3ABulk%3A%3ADoneFlag/markdown));

            sub get_more {
                    if ( my @more = more() ) {
                            return \@more;
                    } else {
                            return;
                    }
            }

## DESCRIPTION
    This role implements the "[Data::Stream::Bulk](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AStream%3A%3ABulk/markdown)" core API in terms of one method ("get_more").

    As a convenience it calls "finished" when the stream is exhausted, so that cleanup may be done.

    This is used by classes like [Data::Stream::Bulk::DBI](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AStream%3A%3ABulk%3A%3ADBI/markdown), [Data::Stream::Bulk::Callback](https://www.chedong.com/phpMan.php/perldoc/Data%3A%3AStream%3A%3ABulk%3A%3ACallback/markdown).

## METHODS
    is_done
        Returns the state of the iterator.

    next
        As long as the iterator is not yet done, calls "get_more".

        If "get_more" returned a false value instead of an array reference then "done" is set,
        "finished" is called, and this "next" does nothing on subsequent calls.

    finished
        A noop by default. Can be overridden if so desired.

## REQUIREDMETHODS
    get_more
        Returns the next block of data as an array ref, or a false value if no items are left.

## AUTHOR
    Yuval Kogman <<nothingmuch@woobling.org>>

## COPYRIGHT AND LICENSE
    This software is copyright (c) 2012 by Yuval Kogman.

    This is free software; you can redistribute it and/or modify it under the same terms as the Perl
    5 programming language system itself.

