NAME
Ekorn::Pipeline::Workers::Manual::Reference - Ekorn::Pipeline::Workers reference
DESCRIPTION
Ekorn::Pipeline::Workers gives Ekorn::Pipeline three stages, in_workers, in_workers_as_ready and once_per. Each runs a function for each value in a pool of workers, separate perls working side by side, and passes the results on to the rest of the pipeline, as any stage does.
This reference says what the stages promise: every argument and option, when workers start and end, what crosses to a worker and back, the order results come in, and what failures and stops do. The user guide shows how to use them, task by task, in tested recipes, and the Guarantees section links each promise to the recipes that show it. The module's POD says the same more briefly, and is the authority where they differ.
Ekorn::Pipeline::Workers needs Perl 5.36 or later, and Ekorn::Pipeline v0.5, and nothing else beyond the modules that come with Perl. Its version is 0.x, so its interface may still change before 1.0. Changes says what each release changed.
Contents
Fresh perls, never clones
Each worker is a new perl, started fresh, never a copy of the program: on Linux and macOS by fork and then, at once, exec of a new perl, and on Windows as a new process. Each talks to the program over a connection of its own on 127.0.0.1, the loopback, and values cross it by Storable.
That one choice explains the rules that follow. Workers were first tried as clones of the program, made by MCE and by fork. On Windows, where fork is emulated with threads, every clone, as it left, tore down its copy of what the program held, a database handle included, and with it the program's own state. Fresh perls passed every check on Linux, macOS and Windows alike. So the rules are the same on all three, and are these:
The function is named, in a module. A new perl can't reach a closure in the program, nor a sub in the program's own script, so the function a worker runs is given by its name,
'Module::function', or as a code reference to a named sub in a module,\&Module::function, and each worker loads its module, by the function's package:lib/My/Work.pmforMy::Work::square. So the package must be the module's own, not a second package in another module's file.initanddoneare named the same way.Each worker sets itself up, in
init, from whatinit_argssends it: a database's DSN, say, never its handle.A worker inherits nothing the program holds: no open handle, no object, no class the program made as it ran, and no change the program made to a module's variables. It loads the module as it is on disk.
It's given two things of the program's: its
@INC, less any hooks, the code references in it, so a worker finds modules where the program does; and its environment,%ENV, as it is when the workers start.It shares the program's STDOUT and STDERR, so what a worker prints may come out late, among the program's own lines.
What a worker costs to start is the price of this: When workers start and end has it.
At a glance
The examples here use modules saved under lib, beside the program, each shown where it's first needed. The first is lib/My/Work.pm:
package My::Work;
use v5.36;
sub square ($n) {
return $n * $n;
}
# None for an odd number, two for an even one.
sub twice_if_even ($n) {
return $n % 2 ? () : ($n, $n);
}
sub shout ($word) {
return uc $word;
}
1;
And a program, beside lib:
use v5.36;
use FindBin;
use lib "$FindBin::Bin/lib";
use Ekorn::Pipeline;
use Ekorn::Pipeline::Workers;
# Each value squared in one of 3 workers, the results in the order the
# values came.
my $squares = Ekorn::Pipeline->new(
in_workers(3, 'My::Work::square'),
);
say join ' ', $squares->(1 .. 6); # 1 4 9 16 25 36
# Each track's artist shouted once, in 2 workers, however many tracks
# they have, and each track joined with its artist's, in the program.
my $credits = Ekorn::Pipeline->new(
once_per(
sub ($track) { $track->{artist} },
2,
'My::Work::shout',
join => sub ($track, $shouted) { "$track->{title}, by $shouted" },
),
);
say for $credits->(
{title => 'Song 2', artist => 'Blur'},
{title => 'Waterloo', artist => 'ABBA'},
{title => 'Beetlebum', artist => 'Blur'},
);
# Song 2, by BLUR
# Waterloo, by ABBA
# Beetlebum, by BLUR
use lib "$FindBin::Bin/lib" lets the program, and so its workers, find the module, from wherever the program is run. Each example after this one needs this program's first five lines, up to its first blank line, and leaves them out.
Importing
use Ekorn::Pipeline::Workers;
exports all three stages. To name what you import:
use Ekorn::Pipeline::Workers qw(in_workers once_per);
To import none, and call each by its full name:
use Ekorn::Pipeline::Workers ();
The stages work with any of Ekorn::Pipeline's parts, its sources, sinks, iterators and feeds among them, and inside a pipeline given as a stage, or one given a name, as any stage does.
The stages
Each stage checks its arguments as it's made, and croaks, at the line that made it, if one is wrong (Diagnostics). To check the function's name, it loads the function's module in the program too, so a name that's wrong, or a module that won't load, is found then, not as the workers start; and so is a function no worker could load, one in the program's script, in any package, or in a second package of a module's file. So the program has the module's classes too, such as an error class the function dies with.
in_workers
in_workers($n, 'Module::function', %options)
in_workers($n, \&Module::function, %options)
Runs the function once for each value, in one of $n workers, and passes on what it returns, in the order the values came. $n is a whole number, 1 or more. The function may return one result, none, or several, as a stage may:
my $twice = Ekorn::Pipeline->new(
in_workers(2, 'My::Work::twice_if_even'),
);
say join ' ', $twice->(1 .. 4); # 2 2 4 4
A code reference to the function does as well as its name, whether or not its module is loaded yet:
my $squares = Ekorn::Pipeline->new(
in_workers(2, \&My::Work::square),
);
say join ' ', $squares->(1 .. 3); # 1 4 9
Its options are init, init_args, done and window.
in_workers_as_ready
in_workers_as_ready($n, 'Module::function', %options)
in_workers_as_ready($n, \&Module::function, %options)
The same, but passing each value's results on as soon as they're back, in the order the values finish, so one slow value holds up none of the rest. With this module, lib/My/Naps.pm:
package My::Naps;
use v5.36;
use Time::HiRes qw(sleep);
# Naps for as many tenths of a second as the value says.
sub nap ($tenths) {
sleep $tenths / 10;
return $tenths;
}
1;
the value that naps longest, given first, comes out first from in_workers, and last from in_workers_as_ready:
my @naps = (5, 1, 3);
my $ordered = Ekorn::Pipeline->new(
in_workers(3, 'My::Naps::nap'),
);
my $as_ready = Ekorn::Pipeline->new(
in_workers_as_ready(3, 'My::Naps::nap'),
);
say join ' ', $ordered->(@naps); # 5 1 3
say join ' ', $as_ready->(@naps); # 1 3 5
Its options are in_workers'.
once_per
once_per($key, $n, 'Module::function', %options)
once_per($key, $n, \&Module::function, %options)
Runs the function once for each distinct key, in one of $n workers, and passes each value on as join makes it, from the value and its key's results. Without a join, each value becomes its key's results.
**
$key** is a code reference, called in the program for each value, given it in$_and as its argument, which returns the value's key. It mustn't return undef.Keys are compared as strings, as a hash's are, and each key's results are kept, for the run.
Only the key crosses to a worker, never the value, and the function is given the key as its value.
A key asked for while its lookup is still running waits for that lookup, rather than starting another.
With this module, lib/My/Lookups.pm:
package My::Lookups;
use v5.36;
use Time::HiRes qw(sleep);
my %country = (ABBA => 'Sweden', Blur => 'England', Cream => 'England');
# An artist's country, as a slow lookup would give it, ABBA's slowest.
sub country ($artist) {
sleep($artist eq 'ABBA' ? 0.4 : 0.1);
return $country{$artist} // 'unknown';
}
1;
each artist is looked up once, and each track joined with the answer:
my @tracks = (
{title => 'Dancing Queen', artist => 'ABBA'},
{title => 'Girls & Boys', artist => 'Blur'},
{title => 'Parklife', artist => 'Blur'},
);
my $from = Ekorn::Pipeline->new(
once_per(
sub ($track) { $track->{artist} },
2,
'My::Lookups::country',
join => sub ($track, $country) { "$track->{title}: $country" },
),
);
say for $from->(@tracks);
# Dancing Queen: Sweden
# Girls & Boys: England
# Parklife: England
Without a join, the tracks become the answers:
my @tracks = (
{title => 'Dancing Queen', artist => 'ABBA'},
{title => 'Girls & Boys', artist => 'Blur'},
{title => 'Parklife', artist => 'Blur'},
);
my $countries = Ekorn::Pipeline->new(
once_per(sub ($track) { $track->{artist} }, 2, 'My::Lookups::country'),
);
say join ' ', $countries->(@tracks); # Sweden England England
Its options are in_workers', and join, hold and ordered. For once_per, window counts keys being looked up, not values.
Options
Each stage takes these options, after its function, as a list of names and values. One the stage doesn't take croaks, as the stage is made, so a misspelt name is never quietly ignored.
init-
**
in_workers,in_workers_as_ready:** yes**
once_per:** yesDefault: none
init_args-
**
in_workers,in_workers_as_ready:** yes**
once_per:** yesDefault:
[] done-
**
in_workers,in_workers_as_ready:** yes**
once_per:** yesDefault: none
window-
**
in_workers,in_workers_as_ready:** yes**
once_per:** yesDefault:
2 * $n join-
**
in_workers,in_workers_as_ready:** no**
once_per:** yesDefault: the key's results
hold-
**
in_workers,in_workers_as_ready:** no**
once_per:** yesDefault: 1000
ordered-
**
in_workers,in_workers_as_ready:** no**
once_per:** yesDefault: 1
init
init => 'Module::function'
init => \&Module::function
A function run once in each worker, as it starts, before the first value is sent, given what init_args holds. What it returns is given to the function, after each value, and to done. It's named, as the function is, for the same reason.
With this module, lib/My/Shop.pm:
package My::Shop;
use v5.36;
# Run once in each worker: what it returns follows each value.
sub open_up ($greeting) {
return ucfirst $greeting;
}
sub serve ($name, $greeting) {
return "$greeting, $name";
}
sub close_up ($greeting) {
return;
}
1;
each worker greets with what its init made:
my $shop = Ekorn::Pipeline->new(
in_workers(
2,
'My::Shop::serve',
init => 'My::Shop::open_up',
init_args => ['good morning'],
done => 'My::Shop::close_up',
),
);
say for $shop->('Ann', 'Bob');
# Good morning, Ann
# Good morning, Bob
init runs in every worker at once, and may take as long as it needs: the first value is sent once all are ready. If it dies in any worker, its message is the run's error, "in_workers couldn't set up a worker", and no value is sent.
init_args
init_args => [@args]
An array reference of what init is given. It crosses to each worker by Storable, so it holds data, such as a DSN and a password, never a handle. Without an init, it croaks, as there's nothing to give it to.
done
done => 'Module::function'
done => \&Module::function
A function run in each worker as it leaves, given what init returned, to disconnect from a database, say. It runs in a worker that leaves idle: every worker, when the run ends normally, and an idle one after a stop or an error. A worker still working then is ended without it. A done that dies writes its message to STDERR, as the worker's, and isn't the run's error, as the run has ended.
window
window => $count
How many values may have reached the stage and not been passed on, by default 2 * $n. It's a whole number, at least $n, so that every worker can be given a value. For once_per, it's how many keys may be looked up at once. Order, the window and hold says what it does.
join
join => sub ($value, @results) { ... }
once_per's only. A code reference, called in the program, given each value, in $_ and as its first argument, and its key's results after it; what it returns is passed on in place of the value. It's called once for each value, so each value can make something of its own from its key's results. Without one, each value becomes its key's results.
hold
hold => $count
once_per's only. How many values may wait for keys still being looked up before the stage waits for the oldest one's, by default
ordered
ordered => 0
once_per's only. With 0, each value is passed on as soon as its key's results are back, rather than in the order the values came, which is the default. in_workers_as_ready is the same for in_workers, which doesn't take this option.
With the module above, ABBA's slow lookup holds up only ABBA's track:
my @tracks = (
{title => 'Dancing Queen', artist => 'ABBA'},
{title => 'Girls & Boys', artist => 'Blur'},
{title => 'Parklife', artist => 'Blur'},
);
my $as_ready = Ekorn::Pipeline->new(
once_per(
sub ($track) { $track->{artist} },
2,
'My::Lookups::country',
join => sub ($track, $country) { "$track->{title}: $country" },
ordered => 0,
),
);
say for $as_ready->(@tracks);
# Girls & Boys: England
# Parklife: England
# Dancing Queen: Sweden
What the function is given
In the worker, the function is called for each value with:
the value, in
$_and as its first argument; foronce_per, the key;**what
initreturned,** if there's aninit, after it.
It's called in list context, and what it returns is its results. It runs inside a run of the worker's own, made to look like the program's, so it sees where its value stands in the program's run, as a stage would:
Ekorn::Pipeline::run_context(), the run's context, from its source;Ekorn::Pipeline::ending(), true while values given by a flush before the stage are going through;result_originalandresult_number, from Ekorn::Pipeline::Context.
A context or an original that can't be frozen, such as one holding an open file, is left behind, and the function sees undef for both. For once_per, the function sees where the first value to ask for its key stands.
result_number is the number the result would have as the value reaches the stage: the run's results so far, plus one. The stage holds results back, so a value sent while results before it are still held sees the same number as they did, which in an ordinary stage it wouldn't. With this module, lib/My/Places.pm:
package My::Places;
use v5.36;
use Ekorn::Pipeline::Context qw(result_number result_original);
sub where ($value) {
return "$value is result " . result_number() . ', from ' . result_original();
}
1;
each value knows its original, but not its place among the results:
my $places = Ekorn::Pipeline->new(
sub ($name) { uc $name },
in_workers(2, 'My::Places::where'),
);
say for $places->('a', 'b');
# A is result 1, from a
# B is result 1, from b
A stage after this one sees each result's own number and original, as What crosses to a worker and back says, so ask for them there.
What crosses to a worker and back
Everything that crosses between the program and a worker is a copy, made by Storable's nfreeze and thaw:
to the worker: each value, or for
once_pereach key;init_args; and where the value stands in the run;back: the function's results, its error, or a stop's values.
So what crosses is plain data, or objects. An object's class must be loaded on the other side for its methods to work there: it arrives blessed into its class, and Storable loads nothing. What can't be frozen, such as a code reference or an open handle, croaks, naming the value by its number, counted from 1 in the order the values reached the stage; for once_per, the order its keys were sent:
my $squares = Ekorn::Pipeline->new(
in_workers(2, 'My::Work::square'),
);
eval { $squares->(sub { 2 }) };
print $@;
# Pipeline stage #1 failed at ... line ...:
# in_workers can't send value #1 to a worker: Can't store CODE items at ... line ...
Results that can't be frozen fail the same way, "in_workers can't send back the results of value #1", and so does an init_args that holds what can't, as the workers start.
The stages keep each value's place with it, as Ekorn::Pipeline's stages that hold values back do. So a stage after them sees, in result_original, the original of the value each result was made from, even when the results come out of order, as in_workers_as_ready's do.
When workers start and end
The workers start as the first value reaches the stage, all
$ntogether, so a run with no values starts none. The stage waits up to 30 seconds for them all to connect, and then for everyinit.There's a pool for each run. A pipeline called twice starts its workers twice. Workers never stay up between runs, so nothing one run left in a worker can reach the next. Give a pipeline all its values in one run, or push them through a feed, which is one run until it's closed.
They end with the run, however it ends. When the run is done, each worker is idle: it runs
done, and leaves. After a stop, at the stage or after it, or an error, an idle worker runsdoneand leaves, and one still working is killed; values not yet sent are dropped.Only the process that started them ends them. A child the program forks during a run, ending its copy of the run, leaves them alone.
Starting a perl isn't free: with the stages' modules alone, about 13 milliseconds a worker on macOS, and on Windows a quarter to half a second for 4 workers. Each value then costs about 32 microseconds on macOS, on top of its work, to cross to a worker and back. So these stages pay for work of milliseconds a value, over many values, not for work of microseconds, or for short runs. A stage that runs a pipeline with workers of its own, for each value, pays the start for each.
Order, the window and hold
**in_workers passes results on in the order the values came. A value's results wait until every value before it has passed on its own. in_workers_as_ready** passes each value's results on as soon as they're back.
At most window values have reached the stage and not been passed on. Of these, up to $n are with workers, and the rest wait, in the program, for a worker to be free. While the window is full, and no result may yet go on, the stage waits, and so takes no new value; so a pipeline pulling from a source takes values from it only as there's room. With in_workers, a slow value can fill the window behind it, leaving workers idle until it's done. A larger window keeps them busy for longer; in_workers_as_ready doesn't wait for it at all. The stage holds at most its window of values and their results.
At the end of a run, once the values have run out, the stage's flush waits for every value it still holds, and passes on all their results together, in the stage's order, as a flush gives its values all at once.
**once_per** passes each value on, joined, in the order the values came, once its key's results are back; with ordered => 0, as soon as they are. A value whose key is already known needs no worker, and goes on as soon as its turn comes. The stage waits while window keys are being looked up, or while hold values wait behind an oldest one whose key isn't back. It keeps every key's results for the run, so its memory grows with the number of distinct keys.
Failures and stops
An error in the function is passed on in its turn, as it was: after the results before it, in the order the stage passes results on. A string keeps its text, with the place it was raised; an object, such as an exception class's, arrives as an object of its class, if Storable can freeze it, or as its message if it can't, as when it holds an open handle. A pipeline reports a stage's error as any stage's, after "Pipeline stage #1 failed at ...", which names the line that ran it; an object it passes on as it is.
With this module, lib/My/Failures.pm:
package My::Failures;
use v5.36;
use Ekorn::Pipeline::Stop;
sub no_three ($n) {
die "no $n\n" if $n == 3;
return $n;
}
sub no_three_object ($n) {
die My::Failures::Error->new("no $n") if $n == 3;
return $n;
}
sub stop_at_three ($n) {
return $n == 3 ? Stop('stopped at 3') : $n;
}
package My::Failures::Error;
sub new ($class, $message) {
return bless {message => $message}, $class;
}
sub message ($self) {
return $self->{message};
}
1;
the error at 3 comes after 1 and 2 have gone on:
my @seen;
my $run = Ekorn::Pipeline->new(
in_workers(2, 'My::Failures::no_three'),
sub ($n) { push @seen, $n; $n },
);
eval { $run->(1 .. 20) };
print $@;
# Pipeline stage #1 failed at ... line ...:
# no 3
say "passed on first: @seen"; # passed on first: 1 2
and an object can be caught by its class, as the program has loaded the function's module:
my $objects = Ekorn::Pipeline->new(
in_workers(2, 'My::Failures::no_three_object'),
);
eval { $objects->(1 .. 20) };
say ref $@, ': ', $@->message if $@ isa My::Failures::Error;
# My::Failures::Error: no 3
A worker that exits without replying, as when its function calls exit, or it's killed, is an error naming the value it had: "in_workers lost worker %s, which exited, status %s, with value #%s", with its process number, its exit status, and the value's number.
A stop in the function, an Ekorn::Pipeline::Stop, stops the run in its turn, with its values after every result before it:
my $stopping = Ekorn::Pipeline->new(
in_workers(2, 'My::Failures::stop_at_three'),
);
say join ' ', $stopping->(1 .. 20); # 1 2 stopped at 3
It's thrown again in the program as an Ekorn::Pipeline::Stop, whatever its class was in the worker; a pipeline knows a stop by isa, so it stops the same. A stop that isn't an array, which carries nothing in Ekorn, carries nothing here. For once_per, a stop's values are passed on as they are, not given to join.
A stop after the stage, such as take's, ends the workers, as When workers start and end says: values not yet sent are dropped, and a worker still working is killed. So, while values are still coming, the work stops with the run, rather than finishing values no one wants. Here the first two naps are short, and the rest take 3 seconds each:
use Ekorn::Pipeline::Stages::Flow qw(take);
use Time::HiRes qw(time);
my $first_two = Ekorn::Pipeline->new(
in_workers(2, 'My::Naps::nap'),
take(2),
);
my $started = time;
my @first = $first_two->(1, 2, (30) x 6);
say "@first"; # 1 2
say time - $started < 2 ? 'the 3-second naps were ended' : 'it waited for them';
# the 3-second naps were ended
Once the values have run out, though, the stage's flush finishes every value it still holds before it passes any on, as a flush gives its values all at once. So a stop after the stage then ends no work early. Above, with only (1, 2, 30, 30), the stage has been given every value by the time 2 is back, and the run waits for both naps.
The flush's limit. At the end of a run, the stage passes on what it still holds in its flush. A stop met there carries every result the flush took before it. But an error met there loses them, with the run, as a flush can't pass values on and then die; they're results no stage after this one sees. A function that turns its failures into results, rather than dying, loses nothing: Keep going: turn each failure into a result shows how.
Guarantees
What the stages promise, each with the how-to's recipes that show it. Every recipe runs as it stands, on Linux, macOS and Windows, on every change.
- Each worker is a process of its own, a new perl, with nothing of the program's but what it's sent, its
@INCand its environment -
A worker is another process, A worker is a new perl, not a copy of yours
- What crosses is a copy, and what can't be copied is refused, naming the value
-
What a worker is given is a copy, Give several results, or none
- Up to
$nvalues are worked on at once, and no more in_workerspasses results on in the order the values camein_workers_as_readypasses each value's results on as soon as they're backinitruns once in each worker, before its first value;doneas it leaves; and a failedinitfails the run-
Set each worker up once, with
init, Tidy up as each worker leaves, withdone - A worker connects to a database for itself, and the program's handle is never touched
-
Run slow queries side by side, each worker connecting for itself
once_perlooks each key up once, and sends only the key-
Look each artist up once, for all their tracks, Keep values that can't be copied
- Each result knows the original of the value it came from, in order or not
- An error takes its turn, after the results before it
- An error object arrives as it was, of its class
- A stop in the function takes its turn, with its values
- A stop after the stage ends the workers
- A worker that dies is an error naming its value
- An error met in the flush loses the results it took with it
- Workers start at a run's first value, so an empty run starts none, and end with the run
-
See that an empty run starts nothing, Run once over many values, not once a value
- Each mistake in a stage's arguments is refused as it's made
One promise has tests in the distribution's t/, rather than a recipe: that a stop met in the flush carries every result the flush took before it.
Who can talk to the workers
Each worker connects to the program on 127.0.0.1, so only programs on the same computer can reach it. The program takes a connection for a worker only if it gives a token the program made for this pool, and the process number of a worker the program started.
The token is 16 bytes from /dev/urandom, where the system has it, and from Perl's rand where it hasn't, as on Windows. It goes to each worker in its environment, as EKORN_PIPELINE_WORKERS_TOKEN, never on its command line, which every user of the computer can read; a process's environment can be read only by its own user and the computer's administrator. The worker takes it out of %ENV as soon as it has read it, so the function, and anything it starts, never sees it. So other users of the computer can't pose as a worker, and be sent what the workers are, init_args included. The program's own user can, as that user can read and change the program's memory already.
Diagnostics
Every message the stages give. The first are given as a stage is made, at the line that made it. The rest come from a run, so a pipeline reports them after "Pipeline stage #1 failed at ...", naming the line that ran it, and each starts with the name of the stage that gave it, in_workers, in_workers_as_ready or once_per; where one names a value, once_per's names a key, as a key is what it sends. In each, %s stands for what the message names: the stage; the function, init or done; a value's number, counted from 1; a worker's process number; or what Storable or the system said. Messages from the function, or from a library it calls, are passed on as they were.
Every message the stages give makes each of the first kind, and says what to do about every one.
As a stage is made
Expected a number of workers of 1 or more:
$nwasn't a whole number, 1 or more.Expected no option %s: the stage doesn't take that option: a misspelling, say, or
ordered, which onlyonce_pertakes.Expected window to be a whole number, and Expected hold to be a whole number: as they say.
Expected a window at least the number of workers: a window less than
$nwould leave some workers never given a value.Expected %s to be a named sub in a module, not an anonymous one: a worker is a new perl, which it can't reach: the function,
initordonewas a code reference to an anonymous sub.Expected %s to be a sub in a module, not the program's %s: a worker is a new perl, which loads modules, not the program: it was a sub of the program's script, by name or by code reference, in
mainor in a package of the script's own.Expected %s to be in a module of its own name, %s, which a worker can load: it was a sub in a second package of a module's file, such as
My::Two::InnerinMy/Two.pm, where a worker would look forMy/Two/Inner.pm.Expected %s to be given by name, as 'Module::function', or as a code reference to one: a worker is a new perl, which a closure in this one can't reach: it was neither, or a name without its module.
Expected %s to exist, but there's no %s: its module loaded, or was loaded already, without the function.
Expected %s's module, %s, to load: %s: the module wouldn't load, for the reason Perl gave, such as its not being found in
@INC.Expected init_args to be an array reference.
Expected init with init_args:
init_argswas given without aninitto give them to.Expected a code reference for the key (from
once_per).Expected a code reference to join (from
once_per).
As a run goes
Expected a key for each value, not undef (from
once_per): a value's key was undef. It's given as the value reaches the stage.%s can't send %s #%s to a worker: %s: the value, or for
once_perthe key, couldn't be frozen.%s can't send back the results of %s #%s: %s: the function's results couldn't be frozen.
%s can't send its init_args to a worker: %s:
init_argsheld what can't be frozen.%s couldn't set up a worker: %s:
initdied, with its message; or the function,initordonewasn't there when the worker loaded its module.%s lost worker %s, which exited, status %s, with %s #%s: a worker ended without replying, as when its function calls
exit.
The last four come from the system, not the program, so no recipe can make them:
%s waited 30s for its workers to start: the workers didn't start, or didn't connect back, as on a computer far too busy.
%s can't listen for its workers: %s: the program couldn't open a socket on 127.0.0.1, as security software might forbid.
%s couldn't start a worker: %s: the system wouldn't start another process.
%s lost worker %s: %s: a worker's connection broke while a value was being sent to it.
SEE ALSO
Ekorn::Pipeline::Workers, Ekorn::Pipeline, Ekorn::Pipeline::Manual::HowTo, Ekorn::Pipeline::Futures::Manual::HowTo
AUTHOR
Iain Campbell <cpanic@cpan.org>
LICENSE
Copyright (c) 2026 by Iain Campbell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.