AnyEvent-Debounce
view release on metacpan or search on metacpan
lib/AnyEvent/Debounce.pm view on Meta::CPAN
=head1 VERSION
version 0.01
=head1 SYNOPSIS
Create a debouncer:
my $damper = AnyEvent::Debounce->new( cb => sub {
my (@events) = @_;
say "Got ", scalar @events, " event(s) in the batch";
say "Got event with args: ", join ',', @$_ for @events;
});
Send it events in rapid succession:
$damper->send(1,2,3);
$damper->send(2,3,4);
Watch the output:
Got 2 events in the batch
( run in 1.826 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )