in reply to Re: Parallel::Forkmanager question
in thread Parallel::Forkmanager question
Hello again jamesgerard1964,
I wanted to try another way using MCE::Loop. It might look something like this.
use strict; use warnings; use MCE::Loop chunk_size => 1, max_workers => 8; my @servers = ('a'..'z'); my $timeout = 10; my $user = "foo"; my $file = "/tmp/hello.txt"; my $rpath = "/tmp"; my $fname = "hello.txt"; mce_loop { my $server = $_; MCE->say("child process running, with a key of $server ($$)"); eval { local $SIG{ALRM} = sub { alarm 0; die "alarm\n" }; alarm $timeout; my $rc = system("scp -p $file $user\@$server:$rpath/$fname"); }; alarm 0; } @servers;
Well, that's another way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parallel::Forkmanager question
by Anonymous Monk on Apr 06, 2017 at 03:00 UTC | |
|
Re^3: Parallel::Forkmanager question
by Anonymous Monk on Apr 06, 2017 at 02:32 UTC | |
by Anonymous Monk on Apr 06, 2017 at 02:44 UTC |