summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-08-03 10:35:08 +0000
committerfukachan <fukachan>2002-08-03 10:35:08 +0000
commit6c250615a382dda02b11da6d0d85c2db5e50fbbd (patch)
tree803b970b6cf6cc6fae06024b3772828a16c531c6 /fml/lib/FML/Process
parente3048b25e467167974d1e68757ec521944a73da0 (diff)
downloadfml8-6c250615a382dda02b11da6d0d85c2db5e50fbbd.tar.gz
fml8-6c250615a382dda02b11da6d0d85c2db5e50fbbd.tar.bz2
fml8-6c250615a382dda02b11da6d0d85c2db5e50fbbd.zip
scheduler_init()
Diffstat (limited to 'fml/lib/FML/Process')
-rw-r--r--fml/lib/FML/Process/Command.pm3
-rw-r--r--fml/lib/FML/Process/Distribute.pm3
-rw-r--r--fml/lib/FML/Process/Error.pm3
-rw-r--r--fml/lib/FML/Process/Kernel.pm18
-rw-r--r--fml/lib/FML/Process/Scheduler.pm93
5 files changed, 116 insertions, 4 deletions
diff --git a/fml/lib/FML/Process/Command.pm b/fml/lib/FML/Process/Command.pm
index 4b8fdd5d..6b97f17a 100644
--- a/fml/lib/FML/Process/Command.pm
+++ b/fml/lib/FML/Process/Command.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Command.pm,v 1.67 2002/07/19 03:11:01 fukachan Exp $
+# $FML: Command.pm,v 1.68 2002/07/25 00:10:11 fukachan Exp $
#
package FML::Process::Command;
@@ -82,6 +82,7 @@ sub prepare
$curproc->resolve_ml_specific_variables( $args );
$curproc->load_config_files( $args->{ cf_list } );
+ $curproc->scheduler_init();
$curproc->parse_incoming_message($args);
$eval = $config->get_hook( 'command_prepare_end_hook' );
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index 7f32d6f4..9bbd4ee3 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.86 2002/07/31 13:02:54 fukachan Exp $
+# $FML: Distribute.pm,v 1.87 2002/07/31 13:22:03 fukachan Exp $
#
package FML::Process::Distribute;
@@ -82,6 +82,7 @@ sub prepare
$curproc->resolve_ml_specific_variables( $args );
$curproc->load_config_files( $args->{ cf_list } );
+ $curproc->scheduler_init();
$curproc->parse_incoming_message($args);
$eval = $config->get_hook( 'distribute_prepare_end_hook' );
diff --git a/fml/lib/FML/Process/Error.pm b/fml/lib/FML/Process/Error.pm
index ce73ed9b..8e7d94ca 100644
--- a/fml/lib/FML/Process/Error.pm
+++ b/fml/lib/FML/Process/Error.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Error.pm,v 1.12 2002/07/29 13:39:43 fukachan Exp $
+# $FML: Error.pm,v 1.13 2002/07/30 04:03:26 fukachan Exp $
#
package FML::Process::Error;
@@ -75,6 +75,7 @@ sub prepare
$curproc->resolve_ml_specific_variables( $args );
$curproc->load_config_files( $args->{ cf_list } );
+ $curproc->scheduler_init();
if ($config->yes('use_error_analyzer')) {
$curproc->parse_incoming_message($args);
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm
index 399cc3ff..490f86fd 100644
--- a/fml/lib/FML/Process/Kernel.pm
+++ b/fml/lib/FML/Process/Kernel.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Kernel.pm,v 1.119 2002/07/30 04:02:33 fukachan Exp $
+# $FML: Kernel.pm,v 1.120 2002/07/31 13:22:03 fukachan Exp $
#
package FML::Process::Kernel;
@@ -193,6 +193,20 @@ sub _print_init
}
+# Descriptions: activate scheduler
+# Arguments: OBJ($curproc) HASH_REF($args)
+# Side Effects: none
+# Return Value: none
+sub scheduler_init
+{
+ my ($curproc, $args) = @_;
+
+ use FML::Process::Scheduler;
+ my $scheduler = new FML::Process::Scheduler $curproc;
+ $curproc->{ _scheduler } = $scheduler;
+}
+
+
# Descriptions: show help and exit here, (ASAP)
# Arguments: OBJ($curproc) HASH_REF($args)
# Side Effects: longjmp() to help
@@ -655,6 +669,7 @@ sub parse_incoming_message
if ($config->yes('use_incoming_mail_cache')) {
my $dir = $config->{ incoming_mail_cache_dir };
my $modulus = $config->{ incoming_mail_cache_size };
+ use File::CacheDir;
my $obj = new File::CacheDir {
directory => $dir,
modulus => $modulus,
@@ -1548,6 +1563,7 @@ sub open_outgoing_message_channel
if ($config->yes('use_outgoing_mail_cache')) {
my $dir = $config->{ outgoing_mail_cache_dir };
my $modulus = $config->{ outgoing_mail_cache_size };
+ use File::CacheDir;
my $obj = new File::CacheDir {
directory => $dir,
modulus => $modulus,
diff --git a/fml/lib/FML/Process/Scheduler.pm b/fml/lib/FML/Process/Scheduler.pm
new file mode 100644
index 00000000..5beae97e
--- /dev/null
+++ b/fml/lib/FML/Process/Scheduler.pm
@@ -0,0 +1,93 @@
+#-*- perl -*-
+#
+# Copyright (C) 2002 Ken'ichi Fukamachi
+# All rights reserved.
+#
+# $FML: Scheduler.pm,v 1.13 2002/07/30 04:03:26 fukachan Exp $
+#
+
+package FML::Process::Scheduler;
+
+use vars qw($debug @ISA @EXPORT @EXPORT_OK);
+use strict;
+use Carp;
+use FML::Log qw(Log LogWarn LogError);
+use FML::Config;
+
+=head1 NAME
+
+FML::Process::Scheduler -- Scheduler utility.
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=cut
+
+
+# Descriptions: dummy constructor.
+# avoid the default fml new() since we do not need it.
+# Arguments: OBJ($self) OBJ($curproc)
+# Side Effects: none
+# Return Value: OBJ
+sub new
+{
+ my ($self, $curproc) = @_;
+ my ($type) = ref($self) || $self;
+ my $me = { _curproc => $curproc };
+ my $config = $curproc->config();
+ my $qdir = $config->{ scheduler_queue_dir };
+
+ unless (-d $qdir) {
+ eval q{
+ use File::Utils qw(mkdirhier);
+ mkdirhier($qdir, $config->{ default_dir_mode } || 0755 );
+ };
+ }
+
+ return bless $me, $type;
+}
+
+
+# Descriptions:
+# Arguments: OBJ($self) STR($key)
+# Side Effects:
+# Return Value: none
+sub queue_in
+{
+ my ($self, $key) = @_;
+}
+
+
+# Descriptions:
+# Arguments: OBJ($self) HASH_REF($args)
+# Side Effects:
+# Return Value: none
+sub exits
+{
+
+}
+
+
+=head1 AUTHOR
+
+Ken'ichi Fukamachi
+
+=head1 COPYRIGHT
+
+Copyright (C) 2002 Ken'ichi Fukamachi
+
+All rights reserved. This program is free software; you can
+redistribute it and/or modify it under the same terms as Perl itself.
+
+=head1 HISTORY
+
+FML::Process::Scheduler appeared in fml5 mailing list driver package.
+See C<http://www.fml.org/> for more details.
+
+=cut
+
+
+1;