php8.5
Home/ Manual/ ev / evwatcher/ EvWatcher::clear

EvWatcher::clear

PHP function Edit on GitHub ✎

(PECL ev >= 0.2.0)

Clear watcher pending status

Description

EvWatcher::clear(): int

If the watcher is pending, this method clears its pending status and returns its revents bitset(as if its callback was invoked). If the watcher isn't pending it does nothing and returns 0.

Sometimes it can be useful to "poll" a watcher instead of waiting for its callback to be invoked, which can be accomplished with this function.

Parameters Parameters

Return Values

In case if the watcher is pending, returns revents bitset as if the watcher callback had been invoked. Otherwise returns 0.

Source: reference/ev/evwatcher/clear.xml · from the official PHP manual (php/doc-en)