Property | Type | Description | |
---|---|---|---|
$id | integer | Process identificator | |
$signals | array | ..] |
Property | Type | Description | |
---|---|---|---|
$collections | array | |
Collections of childrens | |
$delayedSigReg | boolean | If true, we do not register signals automatically at start | |
$pid | integer | PID | |
$shutdown | boolean | Is this thread shutdown? | |
$sigEvents | array | Storage of signal handler events | |
$terminated | boolean | Is this thread terminated? |
Method | Description | |
---|---|---|
__invoke ( ) : void | Invoke magic method | |
eventSighandler ( $fd, $arg ) : void | Called when a signal caught through libevent. | |
getId ( ) : integer | Get ID of this Thread | |
getPid ( ) : integer | Get PID of this Thread | |
ifExists ( ) : boolean | Checks if this process does exist | |
ifExistsByPid ( integer $pid ) : boolean | Checks if given process ID does exist | |
isTerminated ( ) : boolean | Is this thread terminated? | |
setId ( $id ) : void | Set ID of this Thread | |
setTerminated ( ) | ||
sighandler ( $signo ) : void | Called when the signal is caught | |
signal ( $sig ) : boolean | Sends arbitrary signal to the process | |
sleep ( $s ) : boolean | Delays the process execution for the given number of seconds | |
start ( $clearstack = true ) : void | Starts the process | |
stop ( $kill = false ) : void | Terminates the process |
Method | Description | |
---|---|---|
backsig ( $sig ) : boolean | Sends the signal to parent process | |
getTitle ( ) : string | Returns a title of the current process | |
onTerminated ( ) | ||
registerEventSignals ( ) : void | Register signals. | |
registerSignals ( ) : void | Registers signals | |
run ( ) : void | Run thread process | |
setTitle ( string $title ) : boolean | Sets a title of the current process | |
shutdown ( ) : void | Shutdowns the current process properly | |
sigchld ( ) : void | Called when the signal SIGCHLD caught | |
sigint ( ) : void | Called when the signal SIGINT caught | |
sigkill ( ) : void | Called when the signal SIGKILL caught | |
sigquit ( ) : void | Called when the signal SIGTERM caught | |
sigterm ( ) : void | Called when the signal SIGTERM caught | |
sigtimedwait ( $signals, $siginfo, integer $sec, double $nano ) : boolean | Implementation of pcntl_sigtimedwait for Mac. | |
sigwait ( $sec, $nano = 300000000 ) : boolean | Waits for signals, with a timeout | |
unregisterSignals ( ) : void | Unregister signals. | |
waitAll ( boolean $check ) : void | Waits until children is alive | |
waitPid ( ) : boolean | Checks for SIGCHLD |
public eventSighandler ( $fd, $arg ) : void | ||
return | void |
public static ifExistsByPid ( integer $pid ) : boolean | ||
$pid | integer | |
return | boolean | Success |
public isTerminated ( ) : boolean | ||
return | boolean |
protected registerEventSignals ( ) : void | ||
return | void |
protected registerSignals ( ) : void | ||
return | void |
public sighandler ( $signo ) : void | ||
return | void |
protected sigtimedwait ( $signals, $siginfo, integer $sec, double $nano ) : boolean | ||
$sec | integer | |
$nano | double | |
return | boolean | Success |
protected unregisterSignals ( ) : void | ||
return | void |
protected array|Collection[],PHPDaemon\Thread $collections | ||
return | array | |
protected bool $delayedSigReg | ||
return | boolean |
protected array $sigEvents | ||
return | array |
protected bool $terminated | ||
return | boolean |