\AsyncDaemonProcess

创建守护程序

Summary

Methods
Properties
Constants
__construct()
run()
No public properties found
PID_DIR
PIDS_FILE
STATUS_RUNNING
STATUS_STOPPED
STATUS_COMPLETED
checkEnv()
createPidFile()
removePidFile()
updatePidsFile()
kill()
$pidFile
$job
N/A
No private methods found
No private properties found
N/A

Constants

PID_DIR

PID_DIR

PIDS_FILE

PIDS_FILE

STATUS_RUNNING

STATUS_RUNNING

STATUS_STOPPED

STATUS_STOPPED

STATUS_COMPLETED

STATUS_COMPLETED

Properties

$pidFile

$pidFile : string|null

Type

string|null — 守护进程的pid文件,格式为/var/run/php-async-{$pid}.pid

$job

$job : string|null

Type

string|null — 异步任务

Methods

run()

run() : void

创建并执行守护程序

Throws

\Async\Exception\ForkException|\Async\Exception\SessionException

checkEnv()

checkEnv() : void

检验是否安装pcntl扩展

Throws

\Async\Exception\EnvException

运行环境错误

createPidFile()

createPidFile() : void

创建pid文件

Throws

\Async\Exception\FileException

removePidFile()

removePidFile() : void

删除pid文件

Throws

\Async\Exception\FileException

updatePidsFile()

updatePidsFile(string  $status) : void

更新pids文件

Parameters

string $status

Throws

\Async\Exception\PidsFileException|\Async\Exception\FileException|\Async\Exception

kill()

kill() : void

杀死当前进程