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

The EvWatcher class

· 52CE 我爱测

EvWatcher is a base class for all watchers( EvCheck, EvChild etc.). Since EvWatcher 's constructor is abstract, one can't(and don't need to) create EvWatcher objects directly.

The EvWatcher class

(PECL ev >= 0.2.0)

Introduction

EvWatcher is a base class for all watchers( EvCheck, EvChild etc.). Since EvWatcher 's constructor is abstract, one can't(and don't need to) create EvWatcher objects directly.

Class synopsis

abstract class EvWatcher {
/* Properties */
public $is_active;
public $data;
public $is_pending;
public $priority;
/* Methods */
abstract public function __construct()
public function clear(): int
public function feed( int $revents ): void
public function getLoop(): EvLoop
public function invoke( int $revents ): void
public function keepalive( bool $value = ?): bool
public function setCallback( callable $callback ): void
public function start(): void
public function stop(): void
}

Properties

is_active

Readonly. true if the watcher is active. false otherwise.

data

User custom data associated with the watcher

is_pending

Readonly .true if the watcher is pending, i.e. it has outstanding events, but its callback has not yet been invoked. false otherwise. As long, as a watcher is pending(but not active), one must not change its priority.

priority

int between Ev::MINPRI and Ev::MAXPRI. Pending watchers with higher priority will be invoked before watchers with lower priority, but priority will not keep watchers from being executed(except for EvIdle watchers). EvIdle watchers provide functionality to suppress invocation when higher priority events are pending.

Table of Contents

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

资料来源与适用范围

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

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

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