NAME
XAS::Lib::Service - A base class for Services
SYNOPSIS
use XAS::Lib::Service;
my $sevice = XAS::Lib::Service->new(
-logger => $log,
);
DESCRIPTION
This module defines an interface to services. A service is a managed background process.
METHODS
new()
This method is used to initialize the service.
- --poll_interval
-
The number of seconds between polls. Defaults to 5.
- --shutdown_interval
-
The number of seconds before shutdown can happen. Defaults to 25.
It also use parameters from WPM::Lib::Session.
service_startup()
This method should be overridden, it is called when the service is starting up.
service_shutdown()
This method should be overridden, it is called when the service has been stopped or when the system is shutting down.
service_running()
This method should be overridden, it is called every --poll_interval. This is where the work of the service can be done.
service_paused()
This method should be overridden, it is called when the service has been paused.
service_unpaused()
This method should be overridden, it is called when the service has been resumed.
SEE ALSO
AUTHOR
Kevin L. Esteb, <kevin@kesteb.us>
COPYRIGHT AND LICENSE
Copyright (C) 2013 by Kevin L. Esteb
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.