| Schedule-Cron-Nofork documentation | Contained in the Schedule-Cron-Nofork distribution. |
Schedule::Cron::Nofork - Nonforking cron module
Schedule::Cron::Nofork is a nonforking version of Schedule::Cron,
so all jobs will run from one process. This has the advantage that it
works on systems that do not have the fork() call and even on systems
that have it, keeps the system load low because you don't have to create
a new process for every cron job. It has the disadvantages that one long
running job can disrupt the rest of the schedule and that a programming
error in one job will bring down the whole program.
None by default.
Maximilian Maischein, <corion@cpan.org>
Schedule::Cron, crontab(5).
| Schedule-Cron-Nofork documentation | Contained in the Schedule-Cron-Nofork distribution. |
package Schedule::Cron::Nofork; use strict; use warnings; use base 'Schedule::Cron'; use vars qw($VERSION); $VERSION = '0.03'; sub execute { my $self = shift; my $index = shift; my $args = $self->{args}->[$index]; my $dispatch = $args->[0]; die "No subroutine provided with $dispatch" unless ref($dispatch) eq "CODE"; $args = $args->[1]; my @args; if (defined($args) && defined($args->[0])) { push @args,@$args; #dbg "Calling dispatch with ","@args"; } else { #dbg "Calling dispatch with no args"; } $dispatch->(@args); }; 1; __END__