1Data::Stream::Bulk::DonUesFelragC(o3n)tributed Perl DocuDmaetnat:a:tSitorneam::Bulk::DoneFlag(3)
2
3
4
6 Data::Stream::Bulk::DoneFlag - Implement the "is_done" method in terms
7 of a flag
8
10 package Data::Stream::Bulk::Blah;
11 use Moose;
12
13 with qw(Data::Stream::Bulk::DoneFlag);
14
15 sub get_more {
16 if ( my @more = more() ) {
17 return \@more;
18 } else {
19 return;
20 }
21 }
22
24 This role implements the "Data::Stream::Bulk" core API in terms of one
25 method ("get_more").
26
27 As a convenience it calls "finished" when the stream is exhausted, so
28 that cleanup may be done.
29
30 This is used by classes like Data::Stream::Bulk::DBI,
31 Data::Stream::Bulk::Callback.
32
34 is_done
35 Returns the state of the iterator.
36
37 next
38 As long as the iterator is not yet done, calls "get_more".
39
40 If "get_more" returned a false value instead of an array reference then
41 "done" is set, "finished" is called, and this "next" does nothing on
42 subsequent calls.
43
44 finished
45 A noop by default. Can be overridden if so desired.
46
48 get_more
49 Returns the next block of data as an array ref, or a false value if no
50 items are left.
51
53 Yuval Kogman <nothingmuch@woobling.org>
54
56 This software is copyright (c) 2010 by Yuval Kogman.
57
58 This is free software; you can redistribute it and/or modify it under
59 the same terms as the Perl 5 programming language system itself.
60
61
62
63perl v5.12.1 2010-08-24 Data::Stream::Bulk::DoneFlag(3)