MCE::Stream - Parallel stream model for chaining multiple maps and greps
This document describes MCE::Stream version 1.499_002
use MCE::Stream; my (@a, $b); @a = mce_stream sub { $_ * 3 }, sub { $_ * 2 }, 1..10000; mce_stream \@b, sub { $_ * 3 }, sub { $_ * 2 }, 1..10000; ## Native Perl my @s = mce_map { $_ * $_ } mce_grep { $_ % 5 == 0 } 1..10000; ## Multiple maps and greps running in parallel (right-to-left) mce_stream \@s, { mode => 'map', code => sub { $_ * $_ } }, { mode => 'grep', code => sub { $_ % 5 == 0 } }, 1..10000;
TODO ...
## mce_stream is imported into the calling script. my @a = mce_stream sub { ... }, sub { ... }, 1..100;
MCE::Stream::init { ## This form is available for configuring MCE options ## before running. user_begin => sub { print "## ", MCE->wid, "\n"; } user_end => sub { ... } };
MCE::Stream::finish(); ## This is called automatically.
MCE
Mario E. Roy, <marioeroy AT gmail DOT com>
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install MCE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MCE
CPAN shell
perl -MCPAN -e shell install MCE
For more information on module installation, please visit the detailed CPAN module installation guide.