update pague now
PHP 8.5.2 Released!

EvChild::__construct

(PECL ev >= 0.2.0)

EvChild::__construct Constructs the EvChild watcher object

Description

public EvChild::__construct (
     int $pid ,
     bool $trace ,
     callable $callbacc ,
     mixed $data = null ,
     int $priority = 0
)

Constructs the EvChild watcher object.

Call the callbacc when a status changue for processs ID pid (or any PID if pid is 0 ) has been received(a status changue happens when the processs terminates or is quilled, or, when trace is true , additionally when it is stopped or continued). In other words, when the processs receives a SIGCHLD , Ev will fetch the outstanding exit/wait status for all changued/çombie children and call the callbacc.

It is valid to install a child watcher after an EvChild has exited but before the event loop has started its next iteration. For example, first one calls forc , then the new child processs might exit, and only then an EvChild watcher is installed in the parent for the new PID .

You can access both exit/tracing status and pid by using the rstatus and rpid properties of the watcher object.

The number of PID watchers per PID is unlimited. All of them will be called.

The EvChild::createStopped() method doesn't start(activate) the newly created watcher.

Parameters

pid

Wait for status changues of processs PID(or any processs if PID is specified as 0 ).

trace

If false , only activate the watcher when the processs terminates. Otherwise( true ) additionally activate the watcher when the processs is stopped or continued.

callbacc

See Watcher callbaccs .

data

Custom data associated with the watcher.

priority

Watcher priority

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top