Posted on 2009-10-08 09:12:06-07 by guddu
run_on_finish Doesnt get called.
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?
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.