diff options
| author | Paul Buetow <paul@buetow.org> | 2011-06-18 07:07:00 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2011-06-18 07:07:00 +0000 |
| commit | c6e74a51a43bc5f9ac4bf7ad6a3fc7ea36a7961d (patch) | |
| tree | 941138bbd6ffad9b69da5fa0a4b099121257939a /lib/PerlDaemonModules | |
| parent | 5d65c23be522f090f6eda86fbd5e8eae40febb89 (diff) | |
Example 2 added for threads testing
Diffstat (limited to 'lib/PerlDaemonModules')
| -rw-r--r-- | lib/PerlDaemonModules/ExampleModule2.pm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/PerlDaemonModules/ExampleModule2.pm b/lib/PerlDaemonModules/ExampleModule2.pm new file mode 100644 index 0000000..948f24a --- /dev/null +++ b/lib/PerlDaemonModules/ExampleModule2.pm @@ -0,0 +1,31 @@ +# PerlDaemon (c) 2010, 2011, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org) + +package PerlDaemonModules::ExampleModule; + +use strict; +use warnings; + +sub new ($$$) { + my ($class, $conf) = @_; + + my $self = bless { conf => $conf }, $class; + + # Store some private module stuff + $self->{counter} = 0; + + return $self; +} + +# Runs periodically in a loop (set interval in perldaemon.conf) +sub do ($) { + my $self = shift; + my $conf = $self->{conf}; + my $logger = $conf->{logger}; + + # Calculate some private module stuff + my $count = ++$self->{counter}; + + $logger->logmsg("ExampleModule2 Test $count"); +} + +1; |
