Свойство | Type | Description | |
---|---|---|---|
$callbacks | array | ||
$errmsg | error message | ||
$errno | error code | ||
$if_signal | boolean | ||
$name | custom process name | ||
$pid | integer | ||
$runnable | Jenner\SimpleFork\Runnable | callable | ||
$running | boolean | ||
$signal_handlers | signal handlers | ||
$started | if the process is started | ||
$stop_signal | the signal which made the process stop | ||
$term_signal | the signal which made the process terminate |
Méthode | Description | |
---|---|---|
__construct ( string $execution = null, null $name = null ) | ||
errmsg ( ) : string | get pcntl errmsg | |
errno ( ) : integer | get pcntl errno | |
getPid ( ) : integer | get pid | |
ifSignal ( ) | ||
isRunning ( ) : boolean | if the process is running | |
isStarted ( ) : boolean | if the process is started | |
isStopped ( ) : boolean | if the process is stopped | |
name ( string | null $name = null ) : mixed | get or set name | |
registerSignalHandler ( $signal, callable $handler ) | register sub process signal handler, when the sub process start, the handlers will be registered | |
run ( ) | you should overwrite this function if you do not use the Runnable or callback. | |
shutdown ( boolean | true $block = true, integer $signal = SIGTERM ) | kill self | |
start ( ) : string | start the sub process and run the callback | |
wait ( boolean | true $block = true, integer $sleep = 100000 ) | waiting for the sub process exit |
Méthode | Description | |
---|---|---|
getCallable ( ) : array | callable | null | get sub process callback | |
initStatus ( ) | init process status | |
signal ( ) | register signal SIGTERM handler, when the parent process call shutdown and use the default signal, this handler will be triggered | |
updateStatus ( boolean $block = false ) | update the process status |
public __construct ( string $execution = null, null $name = null ) | ||
$execution | string | it can be a Runnable object, callback function or null |
$name | null | process name,you can manager the process by it's name. |
public registerSignalHandler ( $signal, callable $handler ) | ||
$signal | ||
$handler | callable |
public run ( ) |
protected signal ( ) |
protected updateStatus ( boolean $block = false ) | ||
$block | boolean |
protected Runnable,Jenner\SimpleFork|callable $runnable | ||
Résultat | Jenner\SimpleFork\Runnable | callable |