summaryrefslogtreecommitdiff
path: root/lib/PerlDaemonModules/ExampleModule.pm
blob: 1dddc9d0620f8b7c310fecbf52c3633d08bab809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# PerlDaemon (c) 2010, 2011, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org)

package PerlDaemonModules::ExampleModule;

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("ExampleModule Test $count");
}

1;