大网数据广告活动
PHP 语言与运行手册

The EvChild class

· 52CE 我爱测

EvChild watchers trigger when the process receives a SIGCHLD in response to some child status changes (most typically when a child dies or exits). It is permissible to install an EvChild watcher after the child has been forked(which implies it might have already exited), as long

The EvChild class

(PECL ev >= 0.2.0)

Introduction

EvChild watchers trigger when the process receives a SIGCHLD in response to some child status changes (most typically when a child dies or exits). It is permissible to install an EvChild watcher after the child has been forked(which implies it might have already exited), as long as the event loop isn't entered(or is continued from a watcher), i.e. forking and then immediately registering a watcher for the child is fine, but forking and registering a watcher a few event loop iterations later or in the next callback invocation is not.

It is allowed to register EvChild watchers in the default loop only.

Class synopsis

class EvChild extends EvWatcher {
/* Properties */
public $pid;
public $rpid;
public $rstatus;
/* Inherited properties */
public $is_active;
public $data;
public $is_pending;
public $priority;
/* Methods */
public function __construct(
     int $pid ,
     bool $trace ,
     callable $callback ,
     mixed $data = null ,
     int $priority = 0
)
final public static function createStopped(
     int $pid ,
     bool $trace ,
     callable $callback ,
     mixed $data = ?,
     int $priority = ?
): object
public function set( int $pid , bool $trace ): void
/* Inherited methods */
public function EvWatcher::clear(): int
public function EvWatcher::feed( int $revents ): void
public function EvWatcher::getLoop(): EvLoop
public function EvWatcher::invoke( int $revents ): void
public function EvWatcher::keepalive( bool $value = ?): bool
public function EvWatcher::setCallback( callable $callback ): void
public function EvWatcher::start(): void
public function EvWatcher::stop(): void
}

Properties

pid

Readonly. The process ID this watcher watches out for, or 0, meaning any process ID.

rpid

Readonly .The process ID that detected a status change.

rstatus

Readonly. The process exit status caused by rpid.

Table of Contents

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。