Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Crontab in AnyEvent! provide an interface to register callback at specified time.
Perl Perl6
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
eg
lib/AnyEvent
t
.shipit
Changes
MANIFEST
Makefile.PL
README.md
ignore.txt

README.md

AnyEvent-Cron

my $cron = AnyEvent::Cron->new( 
        verbose => 1,
        debug => 1,
        after => 1,
        interval => 1,
        ignore_floating => 1
);

# 00:00 (hour:minute)
$cron->add("00:00" => sub { warn "zero"; })

    # hour : minute : second 
    ->add( "*:*:10" => sub { })
    ->add( "1:*:*" => sub { })

    ->add( DateTime->now => sub { warn "datetime now" } )
    ->run();

or:

$cron->add({  
    type => 'interval',
    second => 0 ,
    triggered => 0,
    callback => sub { 
        warn "SECOND INTERVAL TRIGGERD";
    },
},{  
    type => 'interval',
    hour => DateTime->now->hour , 
    minute =>  DateTime->now->minute ,
    callback => sub { 
        warn "HOUR+MINUTE INTERVAL TRIGGERD";
    },
});

$cron->add({
    type => 'datetime' ,
    callback => sub { warn "DATETIME TRIGGED"  },
    datetime => (sub { 
            return DateTime->now->add_duration( DateTime::Duration->new( minutes => 0 ) ); })->()
    });

my $cv = AnyEvent->condvar;
$cv->recv;

INSTALLATION

To install this module, run the following commands:

perl Makefile.PL
make
make test
make install
Something went wrong with that request. Please try again.