Solaris::ProcessContract::Contract - Manage a Solaris process contract instance via libcontract
# Get the latest contract created in the scope of our process my $contract = $pc->get_latest_contract(); # Get the id of this contract print $contract->id(); # Abandon the process contract $contract->control->abandon(); # Adopt the process contract $contract->control->adopt();
This class allows you to query and control a specific solaris process contract.
Use the "get_contract" in Solaris::ProcessContract or "get_latest_contract" in Solaris::ProcessContract methods to create a new instance of this object instead of calling this yourself.
# Get the most recently created contract in the scope of our process my $contract = $pc->get_latest_contract(); # Get a specific contract by id, if we have permission to do so my $contract = $pc->get_contract( 12345 );
Arguments: none
none
Returns: $id
$id
Returns the id of this contract.
print $contract->id();
Returns: $control
$control
Provides access to the Solaris::ProcessContract::Contract::Control object for this contract.
# Access the control object the easy way $contract->control->abandon(); # Access the control object by reference my $control = $contract->control(); $control->abandon();
This allows you to use the libcontract control functions to make changes to this contract.
Danny Warren
To install Solaris::ProcessContract, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Solaris::ProcessContract
CPAN shell
perl -MCPAN -e shell install Solaris::ProcessContract
For more information on module installation, please visit the detailed CPAN module installation guide.