PHP Class Comos\Qpm\Process\Process

Show file Open project: comos/qpm Class Usage Examples

Protected Properties

Property Type Description
$_current Process

Public Methods

Method Description
current ( ) : Process
fork ( Comos\Qpm\Process\Runnable | Callable $target ) : Comos\Qpm\Process\ChildProcess
getCurrentPid ( ) : integer
getParent ( ) : Process
getPid ( ) : integer
isCurrent ( ) : boolean
kill ( )
process ( $pid ) : Process factory method, to produce an instance of Process
sendSignal ( $sig )
terminate ( )
toBackground ( ) let current process run in the background

Protected Methods

Method Description
__construct ( $pid, null $parentProcessId = null )

Method Details

__construct() protected method

protected __construct ( $pid, null $parentProcessId = null )
$pid
$parentProcessId null

current() public static method

public static current ( ) : Process
return Process

fork() public static method

public static fork ( Comos\Qpm\Process\Runnable | Callable $target ) : Comos\Qpm\Process\ChildProcess
$target Comos\Qpm\Process\Runnable | Callable
return Comos\Qpm\Process\ChildProcess

getCurrentPid() public static method

public static getCurrentPid ( ) : integer
return integer

getParent() public method

public getParent ( ) : Process
return Process returns null on failure It cannot be realtime in some cases. e.g. $child = Process::current()->folkByCallable($fun); echo $child->getParent()->getPid(); If child process changed the parent, you would get the old parent ID.

getPid() public method

public getPid ( ) : integer
return integer

isCurrent() public method

public isCurrent ( ) : boolean
return boolean

kill() public method

public kill ( )

process() public static method

factory method, to produce an instance of Process
public static process ( $pid ) : Process
$pid
return Process

sendSignal() public method

public sendSignal ( $sig )

terminate() public method

public terminate ( )

toBackground() public static method

let current process run in the background
public static toBackground ( )

Property Details

$_current protected static property

protected static Process,Comos\Qpm\Process $_current
return Process