NAME

Solaris::ProcessContract::Contract::Control - Control a Solaris process contract instance via libcontract

SYNOPSIS

# Abandon the process contract
$contract->control->abandon();

# Adopt the process contract
$contract->control->adopt();

# Reset the control insance
$contract->control->reset();

DESCRIPTION

This class allows you to control a process contract using the libcontract control interface.

METHODS

new

Use the "control" in Solaris::ProcessContract::Contract to access this object instead of creating one yourself.

# Access the control object the easy way
$contract->control->abandon();

# Access the control object by reference
my $control = $contract->control();
$control->abandon();

abandon

Arguments: none

Returns: undef

Abandon the contract so that it no longer is in the same contract group as the parent.

$contract->control->abandon();

Even when creating new contracts for child processes, those contracts are still underneath the parent's contract in the contract hierarchy.

By abandoning the contract, you will be placing it at the top of it's own hierarchy, and any monitoring, event triggers or resource limitations from processes in the contract will no longer affect your own.

adopt

Arguments: none

Returns: undef

Adopt the contract so that it is returned to your contract group.

$contract->control->adopt();

This is the opposite of "abandon", in that it will bring an abandoned contract back in to your contract hierarchy.

reset

Arguments: none

Returns: undef

Reset the contract control object, if needed. This will make the control object close and then open back up the file descriptor for the contract control instance.

$contract->control->reset()

SEE ALSO

Solaris::ProcessContract
Solaris::ProcessContract::Contract
Solaris::ProcessContract::Exceptions
libcontract(3)
contract(4)
process(4)

AUTHOR

Danny Warren