Skip to content

Commit

Permalink
Merge pull request #44 from bodo-hugo-barwich/no-29_automated-documen…
Browse files Browse the repository at this point in the history
…tation

Process::SubProcess::Group::add() documentation
  • Loading branch information
bodo-hugo-barwich authored Sep 23, 2023
2 parents edf1fe5 + ad0d483 commit 159360e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 6 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ WriteMakefile(
# VERSION => '2.0.2',
MIN_PERL_VERSION => '5.010',
test => { TESTS => 't/*.t' },
EXE_FILES => ['bin/run_subprocess.pl'],
BUILD_REQUIRES => {
'ExtUtils::MakeMaker' => '6.46',
},
Expand Down
10 changes: 7 additions & 3 deletions lib/Process/SubProcess.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#---------------------------------
# @author Bodo (Hugo) Barwich
# @version 2023-09-22
# @version 2023-09-23
# @package SubProcess Management
# @subpackage Process/SubProcess.pm

Expand Down Expand Up @@ -44,7 +44,7 @@ use IO::Select;
use IPC::Open3;
use Symbol qw(gensym);

our $VERSION = '2.1.6';
our $VERSION = '2.1.7';

=head1 DESCRIPTION
Expand Down Expand Up @@ -378,12 +378,16 @@ sub setCommand {
=item setReadTimeout ( TIMEOUT )
This method sets the C<READTIMEOUT> property as numeric value that represents
the Time in seconds to wait for the process output.
the time in seconds to wait for the command output.
If the process is expected to run longer it is useful to set it to avoid excessive checks.
It is also important for multiple process execusions, because other processes will not
be checked before the read has not timed out.
It can only be set when the Sub Process is not running.
B<Parameters:>
C<TIMEOUT> - is an integer that specifies how long the manager will be waiting for output.
See L<Method C<Launch()>|/"Launch ()">
=back
Expand Down
43 changes: 40 additions & 3 deletions lib/Process/SubProcess/Group.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#---------------------------------
# @author Bodo (Hugo) Barwich
# @version 2023-09-22
# @version 2023-09-23
# @package SubProcess Management
# @subpackage Process/SubProcess/Group.pm

Expand Down Expand Up @@ -153,6 +153,24 @@ sub DESTROY {

=head1 Administration Methods
=over 4
=item add ( [ OBJECT | CLASS ] )
This method adds a B<Process> object to the list of managed processes.
B<Parameters:>
C<OBJECT | CLASS> - is a C<Process::SubProcess> object or a compatible class name.
If a class name or no parameter is given a new object will be created.
B<Returns:> It returns the object that was addded to list.
If an object was given the same will be returned.
See L<Method C<Process::SubProcess::setArrProcess()>|Process::SubProcess/"setReadTimeout ( TIMEOUT )">
=back
=cut

sub add {
Expand Down Expand Up @@ -257,7 +275,7 @@ sub add {
=item setCheckInterval ( INTERVAL )
This method calculates the C<READTIMEOUT> for each C<Process::SubProces> object according to
This method calculates the C<READTIMEOUT> for each C<Process::SubProcess> object according to
the amount of existing objects. The value of the C<READTIMEOUT> for each Process will be rounded
to a whole number.
Expand All @@ -274,7 +292,7 @@ B<Parameters:>
C<INTERVAL> - is an integer that specifies the interval in which each process should
be checked.
See L<Method C<Process::SubProcess::setArrProcess()>|SubProcess/"setReadTimeout ( TIMEOUT )">
See L<Method C<Process::SubProcess::setArrProcess()>|Process::SubProcess/"setReadTimeout ( TIMEOUT )">
=back
Expand Down Expand Up @@ -311,6 +329,25 @@ sub setCheckInterval {
} #if($self->{"_check_interval"} > 0 && scalar(@{$self->{"_array_processes"}}) > 0)
}

=pod
=over 4
=item setReadTimeout ( TIMEOUT )
This method set the C<READTIMEOUT> for each C<Process::SubProcess> object.
B<Parameters:>
C<TIMEOUT> - is an integer that specifies the time in seconds to wait for output
from the command.
See L<Method C<Process::SubProcess::setArrProcess()>|Process::SubProcess/"setReadTimeout ( TIMEOUT )">
=back
=cut

sub setReadTimeout {
my $self = shift;

Expand Down

0 comments on commit 159360e

Please sign in to comment.