PHP 클래스 Ko\ProcessManager

저자: Nikolay Bondarenko ([email protected])
상속: implements Countable, use trait Ko\Mixin\ProcessTitle, use trait Ko\Mixin\EventEmitter
파일 보기 프로젝트 열기: misterion/ko-process 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$children ko\Process[]
$sigTerm boolean
$signalHandler ko\SignalHandler
$spawnWatch ko\Process[]

공개 메소드들

메소드 설명
__construct ( )
count ( ) : integer Return count of currently running child process.
demonize ( ) Forks the currently running process to detach from console.
dispatch ( ) Calls signal handlers for pending signals.
dispatchSignals ( ) Calls signal handlers for pending signals.
fork ( callable $callable ) : ko\Process Forks the currently running process.
getProcessCount ( ) : integer Return count of currently running child process.
handleSigChild ( )
handleSigTerm ( )
hasAlive ( ) : boolean Return TRUE is manager has alive children processes.
onShutdown ( callable $callable ) Master process shutdown handler. Shutdown handler called right after the SIGTERM catches by this class.
spawn ( callable $callable ) : ko\Process
wait ( ) Suspends execution of the current process until all children has exited, or until a signal is delivered whose action is to terminate the current process.

보호된 메소드들

메소드 설명
childProcessDie ( $pid, $status )
createProcess ( callable $callable )
internalEmit ( )
internalFork ( ko\Process $p ) : ko\Process
internalOn ( )
internalSpawn ( ko\Process $p )
setupSignalHandlers ( )

메소드 상세

__construct() 공개 메소드

public __construct ( )

childProcessDie() 보호된 메소드

protected childProcessDie ( $pid, $status )

count() 공개 메소드

Return count of currently running child process.
public count ( ) : integer
리턴 integer

createProcess() 보호된 메소드

protected createProcess ( callable $callable )
$callable callable

demonize() 공개 메소드

Forks the currently running process to detach from console.
public demonize ( )

dispatch() 공개 메소드

Calls signal handlers for pending signals.
public dispatch ( )

dispatchSignals() 공개 메소드

Calls signal handlers for pending signals.
사용 중단: Use ProcessManager::dispatch()
public dispatchSignals ( )

fork() 공개 메소드

Forks the currently running process.
public fork ( callable $callable ) : ko\Process
$callable callable Callable with prototype like function(Ko\Process $p) }
리턴 ko\Process

getProcessCount() 공개 메소드

Return count of currently running child process.
public getProcessCount ( ) : integer
리턴 integer

handleSigChild() 공개 메소드

public handleSigChild ( )

handleSigTerm() 공개 메소드

public handleSigTerm ( )

hasAlive() 공개 메소드

Return TRUE is manager has alive children processes.
public hasAlive ( ) : boolean
리턴 boolean

internalEmit() 보호된 메소드

protected internalEmit ( )

internalFork() 보호된 메소드

protected internalFork ( ko\Process $p ) : ko\Process
$p ko\Process
리턴 ko\Process

internalOn() 보호된 메소드

protected internalOn ( )

internalSpawn() 보호된 메소드

protected internalSpawn ( ko\Process $p )
$p ko\Process

onShutdown() 공개 메소드

Master process shutdown handler. Shutdown handler called right after the SIGTERM catches by this class.
public onShutdown ( callable $callable )
$callable callable

setupSignalHandlers() 보호된 메소드

protected setupSignalHandlers ( )

spawn() 공개 메소드

public spawn ( callable $callable ) : ko\Process
$callable callable Callable with prototype like function(Ko\Process $p) }
리턴 ko\Process

wait() 공개 메소드

Suspends execution of the current process until all children has exited, or until a signal is delivered whose action is to terminate the current process.
public wait ( )

프로퍼티 상세

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

protected Process[],ko $children
리턴 ko\Process[]

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

protected bool $sigTerm
리턴 boolean

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

protected SignalHandler,ko $signalHandler
리턴 ko\SignalHandler

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

protected Process[],ko $spawnWatch
리턴 ko\Process[]