Clio::Process - Process wrapper
version 0.02
my $process = Clio::Process->new( manager => $process_manager, id => $uuid, command => $command, );
All processes are managed by the Clio::ProcessManager. Process runs the $command and writes to the connected clients the command output.
$command
Can be wrapped with InputFilters and OutputFilters defined in <Command> block.
InputFilter
OutputFilter
Consumes the Clio::Role::HasManager.
Process ID.
Command used by the process.
$process->start;
Starts the "command" and passes the command output to the connected clients.
On any error object will stop the command.
$process->stop;
Disconnects the connected clients and stops the command.
Invoked by Clio::ProcessManager.
$process->write( $line );
Writes $line to the STDIN of the command.
$line
STDIN
Can be altered by the InputFilters.
$process->add_client( $client );
Connects $client to the process - from now on the output of the command will be written to $client.
$client
$process->remove_client( $client->id );
Disconnects the $client from the process.
my $connected_clients = $process->clients_count();
Returns the number of connected clients.
if ( $process->is_idle ) { $process->stop; }
Returns true if there are no clients connected, false otherwise.
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.