in reply to Re: Closures, object destruction and memory leaks
in thread Closures, object destruction and memory leaks
The idea is that I want to override any signal handlers that the calling program may have installed so that I can interrupt the processing on the server as needed, but I also want to make sure that the caller does eventually receive the signal.sub execute { my $self = shift; my $req = BigHairyDatabaseInteraction->new(...); { local $SIG{INT} = sub {$req->{_signal} = 2; $req->handleInterrupt; }; local $SIG{TERM} = sub {$req->{_signal} = 15; $req->handleInterrupt; }; $req->executeRequest(); } # If a TERM/INT signal has been delivered during the request # then pass it on to the program itself: if($req->{_signal}) { kill $req->{_signal}, $$; } ... rest of $sth->execute()
So far this appears to work really well...
Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Closures, object destruction and memory leaks
by tilly (Archbishop) on Nov 11, 2003 at 01:54 UTC | |
by mpeppler (Vicar) on Nov 11, 2003 at 15:42 UTC | |
by tilly (Archbishop) on Nov 11, 2003 at 16:11 UTC | |
by mpeppler (Vicar) on Nov 11, 2003 at 16:18 UTC |