CTK::Timeout - Provides execute the code reference wrapped with timeout
Version 1.00
use CTK::Timeout; # Create the timeout object my $to = CTK::Timeout->new(); # Execute unless ($to->timeout_call(sub { sleep 2 } => 1)) { die $to->error if $to->error; }
This class provides execute the code reference wrapped with timeout
Creates the timeout object
my $to = CTK::Timeout->new();
Creates the timeout object without the POSIX "sigaction" supporting (forced off)
my $to = CTK::Timeout->new(0);
die $to->error if $to->error;
Returns error string
Given a code reference (with optional arguments @args) will execute as eval-wrapped with a timeout value (in seconds). This method returns the return-value of the specified code in scalar context
my $retval = $to->timeout_call(sub { sleep 2 } => 1, "foo", "bar");
See Changes file
Changes
POSIX, Config
See TODO file
TODO
"Timeout" in DBI, Sys::SigAction
Serż Minus (Sergey Lepenkov) https://www.serzik.com <abalama@cpan.org>
Copyright (C) 1998-2022 D&D Corporation. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See LICENSE file and https://dev.perl.org/licenses/
LICENSE
To install CTK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CTK
CPAN shell
perl -MCPAN -e shell install CTK
For more information on module installation, please visit the detailed CPAN module installation guide.