|
Hello,
below is the snippet from my code. I am unable to understand why run_on_finish doesnt get called?
foreach my $child (keys %$process )
{
....
...Some processing and populating of variables.
...
if($$checkStatus{'Process Status'} == $processStatusRevHash{'New Request'})
{
$pid = $pm-&rtstart($child) and next;
#Populate request Data.
processRequest($child, $requestIdData);
$pm-&rtfinish($child); # pass an exit code to finish
}
}#foreach my $child (keys %$process )
Here the method processRequest defined in a perl module returns 0.
Below is the run_on_finish code
$pm-&rtrun_on_finish(
sub { my ($pid, $exit_code, $id) = @_;
LogString("** $id just got out of the pool "."with PID $pid and exit code: $exit_code\n", $INFO_LOG_LEVEL);
delete $processData{$pid};
}
The above method is not called once child process exits. It is only called when i stop the application. Any pointers on where I am doing wrong?
|