The two most common uses of signals in relation to the DBI
are for canceling operations when the user types Ctrl-C
(interrupt), and for implementing a timeout using alarm()
and $SIG{ALRM}.
and according to the perlfunc manpage on alarm you would
do something along these lines:
eval { local $SIG{ALRM} = sub {die "alarm\n";}; alarm($timeout); $db->execute($query); alarm(0); }; if ($@) { die "Error" unless $@ eq "alarm\n"; #timed out } else { #didnt }
In reply to Re: DBI timeout
by eduardo
in thread DBI timeout
by Cirollo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |