POE::Component::Cron - Schedule POE Events using a cron spec
use POE::Component::Cron; $s1 = POE::Session->create( inline_states => { _start => sub { $_[KERNEL]->delay( _die_, 120 ); } Tick => sub { print 'tick ', scalar localtime, "\n"; }, } ); # crontab schedule the easy wa $sched = POE::Component::Cron->from_cron( '* * * * *' => $s2->ID => 'Tick' ); # delete some schedule of events $sched->delete();
This component extends POE::Component::Schedule by adding an easy way t specify event schedules using a simple cron spec.
Add a schedule using a simple syntax for plain old cron spec.
POE::Component::Cron-> from_cron('*/5 */2 * * 1' => session => event);
Accepts the cron syntax as defined by DateTime::Event::Cron which is pretty the same as that used by common linux cron.
POE, POE::Component::Schedule perl, DateTime::Set, DateTime::Event::Cron.
Chris Fedde, <cfedde@cpan.org>
Copyright (C) 2008 by Chris Fedde
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.
To install POE::Component::Cron, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Cron
CPAN shell
perl -MCPAN -e shell install POE::Component::Cron
For more information on module installation, please visit the detailed CPAN module installation guide.