Ubic::Service::Common - common way to construct new service by specifying several callbacks
version 1.07
$service = Ubic::Service::Common->new({ start => sub { # implementation-specific }, stop => sub { # implementation-specific }, status => sub { # implementation-specific }, name => "yandex-ppb-something", port => 1234, }); $service->start;
Each service should provide safe start(), stop() and status() methods.
start()
stop()
status()
Construct service object.
Possible parameters:
Mandatory sub reference providing service start mechanism.
The same for stop.
Mandatory sub reference checking if service is alive.
It should return one of running, not running, broken values.
running
not running
broken
This code will be used as safety check against double start and as a watchdog.
Service's name.
Service's port.
Vyacheslav Matjukhin <mmcleric@yandex-team.ru>
To install Ubic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ubic
CPAN shell
perl -MCPAN -e shell install Ubic
For more information on module installation, please visit the detailed CPAN module installation guide.