Proclet - minimalistic Supervisor
use Proclet; my $proclet = Proclet->new; # add service $proclet->service( code => sub { my $job = $jobqueue->grab; work($job); }, worker => 2, ); $proclet->service( code => sub { my $loader = Plack::Loader->load( 'Starlet', port => $port, host => $host || 0, max_workers => 4, ); $loader->run($app); }, ); $proclet->service( code => sub { exec('/usr/bin/memcached','-p','11211'); }, ); $proclet->run;
Proclet is minimalistic Supervisor, fork and manage many services from one perl script.
Create instance of Proclet.
Attributes are as follows:
interval in seconds between spawning services unless a service exits abnormally (default: 0)
number of seconds to deter spawning of services after a service exits abnormally (default: 1)
Add services to Proclet.
Code reference of service
Number of children to fork, default is "1"
run services
Masahiro Nagano <kazeburo {at} gmail.com>
Proc::Launcher::Manager, related module Parallel::Prefork, Proclet used internally
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Proclet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Proclet
CPAN shell
perl -MCPAN -e shell install Proclet
For more information on module installation, please visit the detailed CPAN module installation guide.