]> scm.dxcluster.org Git - spider.git/commitdiff
add Thingy
authorminima <minima>
Wed, 31 Dec 2003 20:04:16 +0000 (20:04 +0000)
committerminima <minima>
Wed, 31 Dec 2003 20:04:16 +0000 (20:04 +0000)
perl/Thingy.pm [new file with mode: 0644]
perl/cluster.pl

diff --git a/perl/Thingy.pm b/perl/Thingy.pm
new file mode 100644 (file)
index 0000000..cf05795
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Thingy handling
+#
+# This is the new fundamental protocol engine handler
+#
+# $Id$
+#
+# Copyright (c) 2004 Dirk Koopman G1TLH
+#
+
+package Thingy;
+
+use vars qw($VERSION $BRANCH);
+$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
+$main::build += $VERSION;
+$main::branch += $BRANCH;
+
+
+use DXChannel;
+use DXDebug;
+
+our @queue;
+
+# we expect all thingies to be subclassed
+sub new
+{
+       my $class = shift;
+       my $self = {@_};
+       
+       bless $self, $class;
+       return $self;
+}
+
+# add the Thingy to the queue
+sub add
+{
+       push @queue, shift;
+}
+
+# dispatch Thingies to action it.
+sub process
+{
+       my $t = pop @queue if @queue;
+
+       $t->process if $t;
+}
+
+1;
+
index 6d4dc90f66b2fc523a8d735069f231642d253341..62227d218080c0c8199b4e1cfbee925a4b92d3e2 100755 (executable)
@@ -99,6 +99,7 @@ use Mrtg;
 use USDB;
 use UDPMsg;
 use QSL;
 use USDB;
 use UDPMsg;
 use QSL;
+use Thingy;
 
 use Data::Dumper;
 use IO::File;
 
 use Data::Dumper;
 use IO::File;
@@ -126,7 +127,7 @@ $reqreg = 0;                                        # 1 = registration required, 2 = deregister people
 use vars qw($VERSION $BRANCH $build $branch);
 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
 use vars qw($VERSION $BRANCH $build $branch);
 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
-$main::build += 5;                             # add an offset to make it bigger than last system
+$main::build += 4;                             # add an offset to make it bigger than last system
 $main::build += $VERSION;
 $main::branch += $BRANCH;
 
 $main::build += $VERSION;
 $main::branch += $BRANCH;
 
@@ -558,7 +559,10 @@ for (;;) {
                DXUser::process();
                DXDupe::process();
                AGWMsg::process();
                DXUser::process();
                DXDupe::process();
                AGWMsg::process();
-                               
+
+               # this where things really start to happen (in DXSpider 2)
+               Thingy::process();
+               
                eval { 
                        Local::process();       # do any localised processing
                };
                eval { 
                        Local::process();       # do any localised processing
                };