AnyEvent-AggressiveIdle
view release on metacpan or search on metacpan
lib/AnyEvent/AggressiveIdle.pm view on Meta::CPAN
use AnyEvent::AggressiveIdle ':all'; # or:
use AnyEvent::AggressiveIdle qw(aggressive_idle stop_aggressive_idle);
aggressive_idle {
my ($pid) = @_;
....
stop_aggressive_idle $pid;
}
The function will throw an exception if invalid PID is received.
=head1 Continuous process.
Sometimes You need to to something continuous inside idle callback. If
You want to stop idle calls until You have done Your work, You can hold
guard inside Your process:
aggressive_idle {
my ($pid, $guard) = @_;
my $timer;
( run in 0.249 second using v1.01-cache-2.11-cpan-496ff517765 )