App-RabbitTail
view release on metacpan or search on metacpan
lib/App/RabbitTail/FileTailer.pm view on Meta::CPAN
use App::RabbitTail::FileTailer;
use AnyEvent;
my $tailer = App::RabbitTail::FileTailer->new(
backoff_increment => 0.1,
max_sleep => 10,
fn => $somefile,
cd => sub { warn("Got line " . $_[0]) },
);
$tailer->tail; # Sets up watcher to fire callbacks, returns
# Rest of your code.
# Enter event loop.
AnyEvent->condvar->recv;
=head1 DESCRIPTION
An instance of App::RabbitTail::FileTailer manages tailing a file with exponential backoff
of checking if the file has been written when no bytes are available to minimise system load.
( run in 0.744 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )