PHP 클래스 PHPDaemon\Thread\Generic

저자: Vasily Zorin ([email protected])
상속: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$id integer Process identificator
$signals array ..]

보호된 프로퍼티들

프로퍼티 타입 설명
$collections array | Collection[] 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?

공개 메소드들

메소드 설명
__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

보호된 메소드들

메소드 설명
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

메소드 상세

__invoke() 공개 메소드

Invoke magic method
public __invoke ( ) : void
리턴 void

backsig() 보호된 메소드

Sends the signal to parent process
protected backsig ( $sig ) : boolean
리턴 boolean Success

eventSighandler() 공개 메소드

Called when a signal caught through libevent.
public eventSighandler ( $fd, $arg ) : void
리턴 void

getId() 공개 메소드

Get ID of this Thread
public getId ( ) : integer
리턴 integer

getPid() 공개 메소드

Get PID of this Thread
public getPid ( ) : integer
리턴 integer

getTitle() 보호된 메소드

Returns a title of the current process
protected getTitle ( ) : string
리턴 string

ifExists() 공개 메소드

Checks if this process does exist
public ifExists ( ) : boolean
리턴 boolean Success

ifExistsByPid() 공개 정적인 메소드

Checks if given process ID does exist
public static ifExistsByPid ( integer $pid ) : boolean
$pid integer
리턴 boolean Success

isTerminated() 공개 메소드

Is this thread terminated?
public isTerminated ( ) : boolean
리턴 boolean

onTerminated() 보호된 메소드

protected onTerminated ( )

registerEventSignals() 보호된 메소드

Register signals.
protected registerEventSignals ( ) : void
리턴 void

registerSignals() 보호된 메소드

Registers signals
protected registerSignals ( ) : void
리턴 void

run() 보호된 메소드

Run thread process
protected run ( ) : void
리턴 void

setId() 공개 메소드

Set ID of this Thread
public setId ( $id ) : void
리턴 void

setTerminated() 공개 메소드

public setTerminated ( )

setTitle() 보호된 메소드

Sets a title of the current process
protected setTitle ( string $title ) : boolean
$title string
리턴 boolean Success

shutdown() 보호된 메소드

Shutdowns the current process properly
protected shutdown ( ) : void
리턴 void

sigchld() 보호된 메소드

Called when the signal SIGCHLD caught
protected sigchld ( ) : void
리턴 void

sighandler() 공개 메소드

Called when the signal is caught
public sighandler ( $signo ) : void
리턴 void

sigint() 보호된 메소드

Called when the signal SIGINT caught
protected sigint ( ) : void
리턴 void

sigkill() 보호된 메소드

Called when the signal SIGKILL caught
protected sigkill ( ) : void
리턴 void

signal() 공개 메소드

Sends arbitrary signal to the process
public signal ( $sig ) : boolean
리턴 boolean Success

sigquit() 보호된 메소드

Called when the signal SIGTERM caught
protected sigquit ( ) : void
리턴 void

sigterm() 보호된 메소드

Called when the signal SIGTERM caught
protected sigterm ( ) : void
리턴 void

sigtimedwait() 보호된 메소드

Implementation of pcntl_sigtimedwait for Mac.
protected sigtimedwait ( $signals, $siginfo, integer $sec, double $nano ) : boolean
$sec integer
$nano double
리턴 boolean Success

sigwait() 보호된 메소드

Waits for signals, with a timeout
protected sigwait ( $sec, $nano = 300000000 ) : boolean
리턴 boolean Success

sleep() 공개 메소드

Delays the process execution for the given number of seconds
public sleep ( $s ) : boolean
리턴 boolean Success

start() 공개 메소드

Starts the process
public start ( $clearstack = true ) : void
리턴 void

stop() 공개 메소드

Terminates the process
public stop ( $kill = false ) : void
리턴 void

unregisterSignals() 보호된 메소드

Unregister signals.
protected unregisterSignals ( ) : void
리턴 void

waitAll() 보호된 메소드

Waits until children is alive
protected waitAll ( boolean $check ) : void
$check boolean
리턴 void

waitPid() 보호된 메소드

Checks for SIGCHLD
protected waitPid ( ) : boolean
리턴 boolean Success

프로퍼티 상세

$collections 보호되어 있는 프로퍼티

Collections of childrens
protected array|Collection[],PHPDaemon\Thread $collections
리턴 array | Collection[]

$delayedSigReg 보호되어 있는 프로퍼티

If true, we do not register signals automatically at start
protected bool $delayedSigReg
리턴 boolean

$id 공개적으로 프로퍼티

Process identificator
public int $id
리턴 integer

$pid 보호되어 있는 프로퍼티

PID
protected int $pid
리턴 integer

$shutdown 보호되어 있는 프로퍼티

Is this thread shutdown?
protected bool $shutdown
리턴 boolean

$sigEvents 보호되어 있는 프로퍼티

Storage of signal handler events
protected array $sigEvents
리턴 array

$signals 공개적으로 정적으로 프로퍼티

..]
public static array $signals
리턴 array

$terminated 보호되어 있는 프로퍼티

Is this thread terminated?
protected bool $terminated
리턴 boolean