NAME

EV::Cron - Add crontab watcher into EV

VERSION

version 0.123600

SYNOPSIS

use 5.010;
use EV;
use EV::Cron;

my @watchers;

push @watchers, EV::cron     '*  * * * *', sub { say                           'Every minute.'; };
push @watchers, EV::cron     '5  0 * * *', sub { say 'Five minutes after midnight, every day.'; };
push @watchers, EV::cron_ns '15 14 1 * *', sub { say  'At 2:15pm on the first of every month.'; };

EV::run;

DESCRIPTION

This module extends EV by adding an easy way to specify event schedules using a crontab line format.

METHODS

cron($cronspec, $callback)

Calls the callback when the event schedules using a crontab line format occurs.

Parameters

$cronspec - SCALAR - The string in crontab line format crontab(5).

$callback - CODEREF - The callback.

Return value

The newly created watcher.

cron_ns($cronspec, $callback)

The cron_ns variant doesn't start (activate) the newly created watcher.

SEE ALSO

EV

AUTHOR

Loïc TROCHET <losyme@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Loïc TROCHET.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.