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