AEAE::Service - Exposes all service availables for managing an AEAE::Command
jerome@eteve.net
This module requires Data::UUID, Carp
my $ticket = AEAE::Service->launchCommand('AEAE::Command', 'param1', 'param2');
print "\nTicket : ".$ticket."\n";
while(1){ sleep(1); my $r = AEAE::Service->checkTicket($ticket);
print "Check : ".$r."\n"; if( $r >= 100 ){ last ; } }
my $std = AEAE::Service->getSTDOUT($ticket);
print "STDOUT: ".$std;
AEAE::Service->cleanTicket($ticket);
Launch the given command and return a ticket.
Usage:
my $cmd = 'AEAE::Command' ; # or any subclass of this. my $ticket = AEAE::Service->launchCommand($cmd, $arg1 , $arg2 ...);
$arg1, $arg2 ... are given to the command as arguments.
Given a ticket, return the pc of advancement of the corresponding command.
If pc >= 100, that means the command is over !
my $ticket = ... ; # A valid ticket my $pc = AEAE::Service->checkTicket($ticket);
Returns the STDOUT of the command. Wait the command to end to have the real STDOUT :)
Usage: my $ticket = ... ; my $stdout = AEAE::Service->getSTDOUT($ticket);
Same as getSTDOUT but for STDERR :)
If an error occured in the execution of the command, returns the error string. Else return an empty string.
Gets only the message associated with the error (without the call stack). Returns empty string if no error occured.
Abort the command corresponding to the ticket.
Usage :
my $ticket = ... ; AEAE::Service->killTicket($ticket);
Returns: the STDOUT of the killed command.
Clean the ressources associated with the ticket. Use it before throwing ticket to rubbish to avoid ressource starvation.
my $ticket = ... ; # A valid ticket AEAE::Service->cleanTicket($ticket); $ticket = undef ; # Ticket is not valid anymore.
To install AEAE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AEAE
CPAN shell
perl -MCPAN -e shell install AEAE
For more information on module installation, please visit the detailed CPAN module installation guide.