App::Chart::Glib::Ex::ChildPid -- object holding child process ID
use App::Chart::Glib::Ex::ChildPid; my $pobj = App::Chart::Glib::Ex::ChildPid->new (pid => $pid); $pobj->kill ('INT'); $pobj->terminate_with_timeout;
A App::Chart::Glib::Ex::ChildPid holds the process ID (an integer) for a child process created by fork or similar spawn.
App::Chart::Glib::Ex::ChildPid
fork
The fork and subprocess emulation described in perlfork doesn't work with Glib process watching (as of Perl-Glib 1.200) and cannot be used with App::Chart::Glib::Ex::ChildPid.
$pobj->kill ()
$pobj->kill ($sig)
Send signal $sig to the $pobj process. $sig defaults to SIGTERM, otherwise it's a string or number per the core kill function (see "kill" in perlfunc).
$sig
$pobj
kill
$pobj->wait ()
$pobj->wait ($flags)
Block and wait for the $pobj process to terminate, as per the core waitpid. The exited signal is also emitted in the usual way if it terminates.
waitpid
exited
pid
The process ID held and operated on. It must be an immediate child of the current process, but can be started by either fork or any of the several Perl fork/spawn/open modules.
kill-on-destroy
If true then when the ChildPid object is destroyed through garbage collection the process is killed and waited if that hasn't already been done.
This is true by default to ensure the child process stops when the parent stops, or when you discard the object as no longer wanted.
exited ($status)
Emitted when the child process exits, either normally or killed by a signal, but not when merely paused by SIGSTOP, SIGTSTP, etc.
This is implemented by a Glib::Child->add_watch (see Glib::MainLoop). Note that function uses SIGCHLD and if you install your own $SIG{'CHLD'} handler then exited won't run.
Glib::Child->add_watch
SIGCHLD
$SIG{'CHLD'}
Glib::MainLoop, IPC::Open3, Proc::SyncExec
http://user42.tuxfamily.org/chart/index.html
Copyright 2008, 2009, 2010, 2011, 2016 Kevin Ryde
Chart is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Chart is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Chart; see the file COPYING. Failing that, see http://www.gnu.org/licenses/.
To install App::Chart, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Chart
CPAN shell
perl -MCPAN -e shell install App::Chart
For more information on module installation, please visit the detailed CPAN module installation guide.