Clio::ProcessManager - Process manager
version 0.02
my $process_manager = Clio::ProcessManager->new( c => $context, );
Process manager is created on application start and manages all processes (Clio::Process).
Consumes the Clio::Role::HasContext and the Clio::Role::UUIDMaker.
while ( my ($id, $process) = each %{ $process_manager->processes } ) { print "Process $id is", ( $process->is_idle ? '' : ' not'), " idle\n"; }
Container for all managed processes.
$process_manager->start;
Starts a number of processes equal to StartCommands and creates the idle processes maintanace loop.
StartCommands
$process_manager->create_process( $cmd );
Create new Clio::Process
$process_manager->get_first_available( %args );
Based on configuration returns first idle process or if none are availble creates a new one.
If $args{client_id} is present then process connected to this client will be returned.
$args{client_id}
my $num_processes = $process_manager->total_count();
Returns number of managed processes.
my $stopped_process = $process_manager->stop_process( $process_id );
Shutdowns process and stops managing it.
Based on the configuration starts new listening processes and stops the idle ones.
Number of processes created at the application start.
MinSpareCommands
Minimum number of idle processes.
MaxSpareCommands
Maximum number of idle processes.
MaxCommands
Maximum number of commands running at the same time.
MaxClientsPerCommand
Maximum number of clients per process.
Alex J. G. Burzyński <ajgb@cpan.org>
This software is copyright (c) 2012 by Alex J. G. Burzyński <ajgb@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Clio, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Clio
CPAN shell
perl -MCPAN -e shell install Clio
For more information on module installation, please visit the detailed CPAN module installation guide.