On Tue, Aug 19, 2003 at 06:11:32PM +0200, Markus Jansen wrote:
> Hi,
>
> I have a program where I need to execute some longish tasks in parallel.
> So far I have understood that POE is some first class choice,
> and that the way to go is to have some POE::Filter::Reference wheels
> spawned off.
>
> However, these wheels have to deal with collecting the longish data itself.
> Recently, I learned that this may be some n GBytes each, so backquotes
> or even file redirection could turn out improper.
>
> I would like to employ POE also - does anybody have experience with
> wheel processes (children) creating one or more wheels again?
>
> Of course I could "fold" the output handling into one hierarchy,
> but this would make a line oriented processing problematic, and a
> load oriented job spawning quite hard.
Using POE::Component::Child, or POE::Wheel::Run, spawns off a task in a
separate process. You can then block with a simple
while (<THINGY>) {
...
}
in the child process, and the rest of POE (in the parent process)
continues on obliviously.
Interesting information is passed back to the parent process through
pipes.
print "interesting stuff\n";
is all it takes to send an event back to the mothership for processing.
POE::Filter::Reference is just one way to pass information across the
pipes between the parent and child process. If you're going to be
streaming lots of textual data, POE::Filter::Line is probably better.
If it's large binary stuff, POE::Filter::Stream, or a custom filter that
understands your specific format.
--
Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/