NAME
XAS::Lib::Service::Win32 - A base class for Win32 Services using POE
SYNOPSIS
use XAS::Lib::Service;
my $sevice = XAS::Lib::Service::Win32->new(
-logger => $log,
-alias => 'session',
-poll_interval => 2,
-shutdown_interval => 25
);
DESCRIPTION
This module provides an interface between Win32 Services and POE sessions. It allows POE to manage the scheduling of sessions while referencing the Win32 SCM event stream.
METHODS
new()
This method is used to initialize the service. It takes the following parameters:
- -alias
-
The name of this POE session.
- -logger
-
This is a session name of the logger.
- -poll_interval
-
This is the interval were the SCM sends SERVICE_RUNNING message. The default is every 2 seconds.
- -shutdown_interval
-
This is the interval to pause the system shutdown so that the service can cleanup after itself. The default is 25 seconds.
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.