PHP Class AsyncPHP\Doorman\Manager\ProcessManager

Inheritance: implements AsyncPHP\Doorman\Manager
Show file Open project: asyncphp/doorman Class Usage Examples

Protected Properties

Property Type Description
$shell null | AsyncPHP\Doorman\Shell

Public Methods

Method Description
__destruct ( )
addRule ( AsyncPHP\Doorman\Rule $rule )
addTask ( AsyncPHP\Doorman\Task $task )
getBinary ( ) : string Gets the path of the PHP runtime.
getLogPath ( ) : null | string
getRules ( ) : AsyncPHP\Doorman\Rules Gets or creates a new Rules instance.
getRunning ( ) : array Get a list of the running tasks.
getShell ( ) : AsyncPHP\Doorman\Shell Gets or creates a Shell instance.
getWaiting ( ) : array Get a list of the waiting tasks.
getWorker ( ) : string Gets the path of the worker script.
removeRule ( AsyncPHP\Doorman\Rule $rule )
setBinary ( string $binary )
setLogPath ( string $logPath )
setRules ( AsyncPHP\Doorman\Rules $rules )
setShell ( AsyncPHP\Doorman\Shell $shell )
setWorker ( string $worker )
tick ( ) : boolean

Private Methods

Method Description
canRemoveTask ( AsyncPHP\Doorman\Task $task ) : boolean Checks whether a task can be removed from the list of running processes.
canRunTask ( AsyncPHP\Doorman\Task $task ) : boolean Checks whether a new task can be run.
getProfileForProcesses ( AsyncPHP\Doorman\Task $task, array $processes ) : AsyncPHP\Doorman\Profile Gets the load profile related to a task.
getStatsForProcesses ( array $processes ) : array Gets processor and memory stats for a list of processes.
getStdErr ( ) : string Gets the path to write stderr to.
getStdOut ( ) : string Gets the path to write stdout to.
getTaskString ( AsyncPHP\Doorman\Task $task ) : string Gets a string representation of a task, to pass to the worker script.
isTaskCancelled ( AsyncPHP\Doorman\Task $task ) : boolean Check if the given task is cancelled.
isTaskExpired ( AsyncPHP\Doorman\Task $task ) : boolean Check if the given task is expired
killTask ( AsyncPHP\Doorman\Task $task ) : boolean Revoke any background processes attached to this task.
newProfile ( ) : AsyncPHP\Doorman\Profile Creates a new Profile instance.
newRules ( ) : AsyncPHP\Doorman\Rules Creates a new Rules instance.
newShell ( ) : AsyncPHP\Doorman\Shell Creates a new Shell instance.
stopSiblingTasks ( AsyncPHP\Doorman\Task $task ) Stops sibling processes of a task.

Method Details

__destruct() public method

public __destruct ( )

addRule() public method

public addRule ( AsyncPHP\Doorman\Rule $rule )
$rule AsyncPHP\Doorman\Rule

addTask() public method

public addTask ( AsyncPHP\Doorman\Task $task )
$task AsyncPHP\Doorman\Task

getBinary() public method

Gets the path of the PHP runtime.
public getBinary ( ) : string
return string

getLogPath() public method

public getLogPath ( ) : null | string
return null | string

getRules() public method

Gets or creates a new Rules instance.
public getRules ( ) : AsyncPHP\Doorman\Rules
return AsyncPHP\Doorman\Rules

getRunning() public method

Get a list of the running tasks.
public getRunning ( ) : array
return array

getShell() public method

Gets or creates a Shell instance.
public getShell ( ) : AsyncPHP\Doorman\Shell
return AsyncPHP\Doorman\Shell

getWaiting() public method

Get a list of the waiting tasks.
public getWaiting ( ) : array
return array

getWorker() public method

Gets the path of the worker script.
public getWorker ( ) : string
return string

removeRule() public method

public removeRule ( AsyncPHP\Doorman\Rule $rule )
$rule AsyncPHP\Doorman\Rule

setBinary() public method

public setBinary ( string $binary )
$binary string

setLogPath() public method

public setLogPath ( string $logPath )
$logPath string

setRules() public method

public setRules ( AsyncPHP\Doorman\Rules $rules )
$rules AsyncPHP\Doorman\Rules

setShell() public method

public setShell ( AsyncPHP\Doorman\Shell $shell )
$shell AsyncPHP\Doorman\Shell

setWorker() public method

public setWorker ( string $worker )
$worker string

tick() public method

public tick ( ) : boolean
return boolean

Property Details

$shell protected property

protected null|Shell,AsyncPHP\Doorman $shell
return null | AsyncPHP\Doorman\Shell