首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

EvChild (class)

Introduction

(PECL ev >= 0.2.0)

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

EvChild extends EvWatcher {

/* Properties */

public $pid ;

public $rpid ;

public $rstatus ;

/* Inherited properties */

public $is_active ;

public $data ;

public $is_pending ;

public $priority ;

/* Methods */

代码语言:javascript
复制
public __construct (  int $pid  ,  bool $trace  ,  callable $callback  [,  mixed $data  = NULL  [,  int $priority  = 0  ]] )
代码语言:javascript
复制
final public static object createStopped (  int $pid  ,  bool $trace  ,  callable $callback  [,  mixed $data  [,  int $priority  ]] )
代码语言:javascript
复制
public void set (  int $pid  ,  bool $trace  )

/* Inherited methods */

代码语言:javascript
复制
public int EvWatcher::clear ( void )
代码语言:javascript
复制
abstract public EvWatcher::__construct ( void )
代码语言:javascript
复制
public void EvWatcher::feed (  int $revents  )
代码语言:javascript
复制
public EvLoop EvWatcher::getLoop ( void )
代码语言:javascript
复制
public void EvWatcher::invoke (  int $revents  )
代码语言:javascript
复制
public bool EvWatcher::keepalive ([  bool $value  ] )
代码语言:javascript
复制
public void EvWatcher::setCallback (  callable $callback  )
代码语言:javascript
复制
public void EvWatcher::start ( void )
代码语言:javascript
复制
public void 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

  • EvChild::__construct — Constructs the EvChild watcher object
  • EvChild::createStopped — Create instance of a stopped EvCheck watcher
  • EvChild::set — Configures the watcher

← EvCheck::createStopped

EvChild::__construct →

代码语言:txt
复制
 © 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券