Query: munin::common::timeout
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Munin::Common::Timeout(3pm) User Contributed Perl Documentation Munin::Common::Timeout(3pm)NAMEMunin::Common::Timeout - Run code with a timeout. May nest.SYNOPSISuse Munin::Common::Timeout; do_with_timeout(50, sub { # ... do_with_timeout(5, sub { # ... # ... }); # ... });DESCRIPTIONSee also Time::Out, Sys::AlarmCallSUBROUTINESdo_with_timeout my $finished_with_no_timeout = do_with_timeout($seconds, $code_ref) or die "Timed out!"; Executes $block with a timeout of $seconds. Returns the return value of the $block if it completed within the timeout. If the timeout is reached and the code is still running, it halts it and returns undef. NB: every $code_ref should return something defined, otherwise the caller doesn't know if a timeout occured. Calls to do_with_timeout() can be nested. Any exceptions raised by $block are propagated. perl v5.14.2 2013-11-12 Munin::Common::Timeout(3pm)
Similar Topics in the Unix Linux Community |
---|
How can I do this in VI editor? |
One instance of comparing grep and awk |
Weird 'find' results |
New UNIX and Linux History Sections |