DynGig::Multiplex::CMD - Multiplexed Fork Client
use DynGig::Multiplex::CMD; my @target = qw( host1 host2 ... ); my %config = ( timeout => 30, buffer => 'bob loblaw', ## {} is replaced with each of the individual 'targets'. ## also assuming no SSH password/pass phrase challenge. command => 'ssh {} wc', ); my $client = DynGig::Multiplex::CMD->new( map { $_ => \%config } @target ); my %option = ( timeout => 300, ## global timeout in seconds max_buf => 1024, ## max number of bytes in each read buffer multiplex => 100, ## max number of children processes verbose => *STDERR ## report progress to STDERR ); if ( $client->run( %option ) ) { my $result = $client->result() || {}; my $error = $client->error() || {}; } else { print $client->error(); }
Launches client with the following parameter. Returns 1 if successful. Returns 0 otherwise.
timeout : global timeout in seconds max_buf : max number of bytes in each read buffer multiplex : max number of children processes verbose : report progress to a file handle opened for write
Returns undef if no result. Returns a HASH reference indexed by 'target'.
Returns undef if no error. Returns a string if a global error occurred, else if errors occurred with children processes, returns a HASH reference indexed by 'target'.
IPC::Open3 and IO::Poll
See DynGig::Multiplex
To install DynGig::Multiplex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DynGig::Multiplex
CPAN shell
perl -MCPAN -e shell install DynGig::Multiplex
For more information on module installation, please visit the detailed CPAN module installation guide.