|
NAMEData::Stream::Bulk - N at a time iteration API VERSIONversion 0.11 SYNOPSIS # get a bulk stream from somewere
my $s = Data::Stream::Bulk::Foo->new( ... );
# can be used like this:
until ( $s->is_done ) {
foreach my $item ( $s->items ) {
process($item);
}
}
# or like this:
while( my $block = $s->next ) {
foreach my $item ( @$block ) {
process($item);
}
}
DESCRIPTIONThis module tries to find middle ground between one at a time and all at once processing of data sets. The purpose of this module is to avoid the overhead of implementing an iterative api when this isn't necessary, without breaking forward compatibility in case that becomes necessary later on. The API optimizes for when a data set typically fits in memory and is returned as an array, but the consumer cannot assume that the data set is bounded. The API is destructive in order to minimize the chance that resultsets are leaked due to improper usage. APIRequired MethodsThe API requires two methods to be implemented:
Convenience Methods
CLASSES
SEE ALSOHOP::Stream, Iterator, Class::Iterator etc for one by one iteration DBI, DBIx::Class::ResultSet POE::Filter Data::Page Parallel::Iterator <http://en.wikipedia.org/wiki/MapReduce>, LISP, and all that other kool aid TODO
VERSION CONTROLThis module is maintained using git. You can get the latest version from <http://github.com/nothingmuch/data-stream-bulk/>. AUTHORYuval Kogman <nothingmuch@woobling.org> COPYRIGHT AND LICENSEThis 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.
|