'int'], default: '')] $revents) { } /** * Returns the loop responsible for the watcher. * * @return EvLoop Event loop object responsible for the watcher. */ public function getLoop() { } /** * Invokes the watcher callback with the given received events bit mask. * * @param int $revents Bit mask of watcher received events. */ public function invoke(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $revents) { } /** * Configures whether to keep the loop from returning. * * Configures whether to keep the loop from returning. With keepalive value set to FALSE the watcher won't keep * Ev::run() / EvLoop::run() from returning even though the watcher is active. * * Watchers have keepalive value TRUE by default. * * Clearing keepalive status is useful when returning from Ev::run() / EvLoop::run() just because of the watcher * is undesirable. It could be a long running UDP socket watcher or so. * * @param bool $value With keepalive value set to FALSE the watcher won't keep Ev::run() / EvLoop::run() from * returning even though the watcher is active. */ public function keepalive(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $value = true) { } /** * Sets new callback for the watcher. * * @param callable $callback void callback ([ object $watcher = NULL [, int $revents = NULL ]] ) */ public function setCallback(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback) { } /** * Starts the watcher. * * Marks the watcher as active. Note that only active watchers will receive events. */ public function start() { } /** * Stops the watcher. * * Marks the watcher as inactive. Note that only active watchers will receive events. */ public function stop() { } } /** * Class EvCheck * * EvPrepare and EvCheck watchers are usually used in pairs. EvPrepare watchers get invoked before the process blocks, * EvCheck afterwards. * * It is not allowed to call EvLoop::run() or similar methods or functions that enter the current event loop from either * EvPrepare or EvCheck watchers. Other loops than the current one are fine, however. The rationale behind this is that * one don't need to check for recursion in those watchers, i.e. the sequence will always be: EvPrepare -> blocking -> * EvCheck , so having a watcher of each kind they will always be called in pairs bracketing the blocking call. * * The main purpose is to integrate other event mechanisms into libev and their use is somewhat advanced. They could be * used, for example, to track variable changes, implement custom watchers, integrate net-snmp or a coroutine library * and lots more. They are also occasionally useful to cache some data and want to flush it before blocking. * * It is recommended to give EvCheck watchers highest( Ev::MAXPRI ) priority, to ensure that they are being run before * any other watchers after the poll (this doesn’t matter for EvPrepare watchers). * * Also, EvCheck watchers should not activate/feed events. While libev fully supports this, they might get executed * before other EvCheck watchers did their job. */ final class EvCheck extends EvWatcher { /** * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * @param callable $callback * @param mixed $data * @param int $priority * @return EvCheck */ final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) { } } /** * Class EvChild * * 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. */ final class EvChild extends EvWatcher { /** @var int The process ID this watcher watches out for, or 0, meaning any process ID. */ #[Immutable] public $pid; /** @var int The process ID that detected a status change. */ #[Immutable] public $rpid; /** @var int The process exit status caused by rpid. */ #[Immutable] public $rstatus; /** * Constructs the EvChild watcher object. * * Call the callback when a status change for process ID pid (or any PID if pid is 0) has been received (a status * change happens when the process terminates or is killed, or, when trace is TRUE, additionally when it is stopped * or continued). In other words, when the process receives a SIGCHLD, Ev will fetch the outstanding exit/wait * status for all changed/zombie children and call the callback. * * 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 fork , then the new child process 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. * * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally * activate the watcher when the process is stopped or continued. * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pid, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $trace, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * Create instance of a stopped EvCheck watcher. * * The same as EvChild::__construct() , but doesn't start the watcher automatically. * * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally * activate the watcher when the process is stopped or continued. * @param callable $callback * @param mixed $data * @param int $priority * * @return EvChild */ final public static function createStopped( int $pid, bool $trace, mixed $callback, mixed $data = null, int $priority = 0, ) { } /** * Configures the watcher * * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally * activate the watcher when the process is stopped or continued. */ public function set( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pid, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $trace, ) { } } /** * Class EvEmbed * * Used to embed one event loop into another. */ final class EvEmbed extends EvWatcher { /** @var EvLoop The embedded loop */ #[Immutable] public $embed; /** * Constructs the EvEmbed object. * * This is a rather advanced watcher type that lets to embed one event loop into another(currently only IO events * are supported in the embedded loop, other types of watchers might be handled in a delayed or incorrect fashion * and must not be used). * * See the libev documentation for details. * * This watcher is most useful on BSD systems without working kqueue to still be able to handle a large number of * sockets. * * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( EvLoop $other, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * Configures the watcher. * * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). */ public function set(EvLoop $other) { } /** * Make a single, non-blocking sweep over the embedded loop. */ public function sweep() { } /** * Create stopped EvEmbed watcher object * * The same as EvEmbed::__construct() , but doesn't start the watcher automatically. * * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). * @param callable $callback * @param mixed $data * @param int $priority * * @return EvEmbed */ final public static function createStopped(EvLoop $other, mixed $callback, mixed $data = null, int $priority = 0) { } } /** * Class EvIo * * EvIo watchers check whether a file descriptor(or socket, or a stream castable to numeric file descriptor) is readable * or writable in each iteration of the event loop, or, more precisely, when reading would not block the process and * writing would at least be able to write some data. This behaviour is called level-triggering because events are kept * receiving as long as the condition persists. To stop receiving events just stop the watcher. * * The number of read and/or write event watchers per fd is unlimited. Setting all file descriptors to non-blocking mode * is also usually a good idea (but not required). * * Another thing to watch out for is that it is quite easy to receive false readiness notifications, i.e. the callback * might be called with Ev::READ but a subsequent read() will actually block because there is no data. It is very easy * to get into this situation. Thus it is best to always use non-blocking I/O: An extra read() returning EAGAIN (or * similar) is far preferable to a program hanging until some data arrives. * * If for some reason it is impossible to run the fd in non-blocking mode, then separately re-test whether a file * descriptor is really ready. Some people additionally use SIGALRM and an interval timer, just to be sure they won't * block infinitely. * * Always consider using non-blocking mode. */ final class EvIo extends EvWatcher { /** @var resource A stream opened with fopen() or similar functions, numeric file descriptor, or socket. */ #[Immutable] public $fd; /** @var int Ev::READ and/or Ev::WRITE. See the bit masks. */ #[Immutable] #[ExpectedValues(flags: [Ev::READ, Ev::WRITE])] public $events; /** * Constructs EvIo watcher object. * * Constructs EvIo watcher object and starts the watcher automatically. * * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * Configures the watcher. * * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. */ public function set( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events, ) { } /** * Create stopped EvIo watcher object. * * The same as EvIo::__construct() , but doesn't start the watcher automatically. * * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. * @param callable $callback * @param mixed $data * @param int $priority * * @return EvIo */ final public static function createStopped( mixed $fd, int $events, mixed $callback, mixed $data = null, int $priority = 0, ) { } } /** * Class EvPeriodic * * Periodic watchers are also timers of a kind, but they are very versatile. * * Unlike EvTimer, EvPeriodic watchers are not based on real time (or relative time, the physical time that passes) but * on wall clock time (absolute time, calendar or clock). The difference is that wall clock time can run faster or * slower than real time, and time jumps are not uncommon (e.g. when adjusting it). * * EvPeriodic watcher can be configured to trigger after some specific point in time. For example, if an EvPeriodic * watcher is configured to trigger "in 10 seconds" (e.g. EvLoop::now() + 10.0 , i.e. an absolute time, not a delay), * and the system clock is reset to January of the previous year , then it will take a year or more to trigger the event * (unlike an EvTimer , which would still trigger roughly 10 seconds after starting it as it uses a relative timeout). * * As with timers, the callback is guaranteed to be invoked only when the point in time where it is supposed to trigger * has passed. If multiple timers become ready during the same loop iteration then the ones with earlier time-out values * are invoked before ones with later time-out values (but this is no longer true when a callback calls EvLoop::run() * recursively). */ final class EvPeriodic extends EvWatcher { /** * @var float When repeating, this contains the offset value, otherwise this is the absolute point in time (the * offset value passed to EvPeriodic::set(), although libev might modify this value for better numerical * stability). */ public $offset; /** * @var float The current interval value. Can be modified any time, but changes only take effect when the periodic * timer fires or EvPeriodic::again() is being called. */ public $interval; /** * Constructs EvPeriodic watcher object. * * Constructs EvPeriodic watcher object and starts it automatically. EvPeriodic::createStopped() method creates * stopped periodic watcher. * * @param float $offset When repeating, this contains the offset value, otherwise this is the absolute point in * time (the offset value passed to EvPeriodic::set(), although libev might modify this value for better * numerical stability). * @param float $interval The current interval value. Can be modified any time, but changes only take effect when * the periodic timer fires or EvPeriodic::again() is being called. * @param null|callable $reschedule_cb If set, tt must return the next time to trigger, based on the passed time value * (that is, the lowest time value larger than or equal to the second argument). It will usually be called just * before the callback will be triggered, but might be called at other times, too. * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset, #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * Simply stops and restarts the periodic watcher again. * * Simply stops and restarts the periodic watcher again. This is only useful when attributes are changed. * * @return void */ public function again() { } /** * Returns the absolute time that this watcher is supposed to trigger next. * * When the watcher is active, returns the absolute time that this watcher is supposed to trigger next. This is not * the same as the offset argument to EvPeriodic::set() or EvPeriodic::__construct(), but indeed works even in * interval mode. * * @return float Rhe absolute time this watcher is supposed to trigger next in seconds. */ public function at() { } /** * Create a stopped EvPeriodic watcher * * Create EvPeriodic object. Unlike EvPeriodic::__construct() this method doesn't start the watcher automatically. * * @param float $offset When repeating, this contains the offset value, otherwise this is the absolute point in * time (the offset value passed to EvPeriodic::set(), although libev might modify this value for better * numerical stability). * @param float $interval The current interval value. Can be modified any time, but changes only take effect when * the periodic timer fires or EvPeriodic::again() is being called. * @param null|callable $reschedule_cb If set, tt must return the next time to trigger, based on the passed time value * (that is, the lowest time value larger than or equal to the second argument). It will usually be called just * before the callback will be triggered, but might be called at other times, too. * @param callable $callback * @param mixed $data * @param int $priority * * @return EvPeriodic */ final public static function createStopped( float $offset, float $interval, mixed $reschedule_cb, mixed $callback, mixed $data = null, int $priority = 0, ) { } /** * Configures the watcher * @param float $offset The same meaning as for {@see EvPeriodic::__construct} * @param float $interval The same meaning as for {@see EvPeriodic::__construct} * @param null|callable $reschedule_cb The same meaning as for {@see EvPeriodic::__construct} * @return void */ public function set( #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset, #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb = null, ) { } } /** * Class EvPrepare * * EvPrepare and EvCheck watchers are usually used in pairs. EvPrepare watchers get invoked before the process blocks, * EvCheck afterwards. * * It is not allowed to call EvLoop::run() or similar methods or functions that enter the current event loop from either * EvPrepare or EvCheck watchers. Other loops than the current one are fine, however. The rationale behind this is that * one don't need to check for recursion in those watchers, i.e. the sequence will always be: EvPrepare -> blocking -> * EvCheck, so having a watcher of each kind they will always be called in pairs bracketing the blocking call. * * The main purpose is to integrate other event mechanisms into libev and their use is somewhat advanced. They could be * used, for example, to track variable changes, implement custom watchers, integrate net-snmp or a coroutine library * and lots more. They are also occasionally useful to cache some data and want to flush it before blocking. * * It is recommended to give EvCheck watchers highest (Ev::MAXPRI) priority, to ensure that they are being run before * any other watchers after the poll (this doesn’t matter for EvPrepare watchers). * * Also, EvCheck watchers should not activate/feed events. While libev fully supports this, they might get executed * before other EvCheck watchers did their job. */ final class EvPrepare extends EvWatcher { /** * Constructs EvPrepare watcher object. * * Constructs EvPrepare watcher object and starts the watcher automatically. If you need a stopped watcher, consider * using EvPrepare::createStopped(). * * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * Creates a stopped instance of EvPrepare watcher. * * Creates a stopped instance of EvPrepare watcher. Unlike EvPrepare::__construct(), this method doesn't start the * watcher automatically. * * @param callable $callback * @param mixed $data * @param int $priority * * @return EvPrepare */ final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) { } } /** * Class EvSignal * * EvSignal watchers will trigger an event when the process receives a specific signal one or more times. Even though * signals are very asynchronous, libev will try its best to deliver signals synchronously, i.e. as part of the normal * event processing, like any other event. * * There is no limit for the number of watchers for the same signal, but only within the same loop, i.e. one can watch * for SIGINT in the default loop and for SIGIO in another loop, but it is not allowed to watch for SIGINT in both the * default loop and another loop at the same time. At the moment, SIGCHLD is permanently tied to the default loop. * * If possible and supported, libev will install its handlers with SA_RESTART (or equivalent) behaviour enabled, so * system calls should not be unduly interrupted. In case of a problem with system calls getting interrupted by signals, * all the signals can be blocked in an EvCheck watcher and unblocked in a EvPrepare watcher. */ final class EvSignal extends EvWatcher { /** @var int Signal number. See the constants exported by pcntl extension. See also signal(7) man page. */ #[Immutable] public $signum; /** * Constructs EvSignal watcher object * * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $signum, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * Configures the watcher. * * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. */ public function set(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $signum) { } /** * Creates a stopped instance of EvSignal watcher. * * Creates a stopped instance of EvSignal watcher. Unlike EvPrepare::__construct(), this method doesn't start the * watcher automatically. * * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. * @param callable $callback * @param mixed $data * @param int $priority * * @return EvSignal */ final public static function createStopped(int $signum, mixed $callback, mixed $data = null, int $priority = 0) { } } /** * Class EvStat * * EvStat monitors a file system path for attribute changes. It calls stat() on that path in regular intervals (or when * the OS signals it changed) and sees if it changed compared to the last time, invoking the callback if it did. * * The path does not need to exist: changing from "path exists" to "path does not exist" is a status change like any * other. The condition "path does not exist" is signified by the 'nlink' item being 0 (returned by EvStat::attr() * method). * * The path must not end in a slash or contain special components such as '.' or '..'. The path should be absolute: if * it is relative and the working directory changes, then the behaviour is undefined. * * Since there is no portable change notification interface available, the portable implementation simply calls stat() * regularly on the path to see if it changed somehow. For this case a recommended polling interval can be specified. If * one specifies a polling interval of 0.0 (highly recommended) then a suitable, unspecified default value will be used * (which could be expected to be around 5 seconds, although this might change dynamically). libev will also impose a * minimum interval which is currently around 0.1 , but that’s usually overkill. * * This watcher type is not meant for massive numbers of EvStat watchers, as even with OS-supported change * notifications, this can be resource-intensive. */ final class EvStat extends EvWatcher { /** * @var float Hint on how quickly a change is expected to be detected and should normally be * specified as 0.0 to let libev choose a suitable value. */ #[Immutable] public $interval; /** @var string The path to wait for status changes on. */ #[Immutable] public $path; /** * Constructs EvStat watcher object. * * Constructs EvStat watcher object and starts the watcher automatically. * * @param string $path The path to wait for status changes on. * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified * as 0.0 to let libev choose a suitable value. * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * @return array The values most recently detect by Ev (without actual stat'ing). See stat(2) man page for details. */ public function attr() { } /** * @return array Just like EvStat::attr() , but returns the previous set of values. */ public function prev() { } /** * Configures the watcher. * * @param string $path The path to wait for status changes on. * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified * as 0.0 to let libev choose a suitable value. */ public function set( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, ) { } /** * Initiates the stat call. * * Initiates the stat call(updates internal cache). It stats (using lstat) the path specified in the watcher and * sets the internal cache to the values found. * * @return bool TRUE if path exists. Otherwise FALSE. */ public function stat() { } /** * Create a stopped EvStat watcher object. * * Creates EvStat watcher object, but doesn't start it automatically (unlike EvStat::__construct()). * * @param string $path The path to wait for status changes on. * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified * as 0.0 to let libev choose a suitable value. * @param callable $callback * @param mixed $data * @param int $priority * * @return EvStat */ final public static function createStopped( string $path, float $interval, mixed $callback, mixed $data = null, int $priority = 0, ) { } } /** * Class EvTimer * * EvTimer watchers are simple relative timers that generate an event after a given time, and optionally repeating in * regular intervals after that. * * The timers are based on real time, that is, if one registers an event that times out after an hour and resets the * system clock to January last year, it will still time out after( roughly) one hour. "Roughly" because detecting time * jumps is hard, and some inaccuracies are unavoidable. * * The callback is guaranteed to be invoked only after its timeout has passed (not at, so on systems with very * low-resolution clocks this might introduce a small delay). If multiple timers become ready during the same loop * iteration then the ones with earlier time-out values are invoked before ones of the same priority with later time-out * values (but this is no longer true when a callback calls EvLoop::run() recursively). * * The timer itself will do a best-effort at avoiding drift, that is, if a timer is configured to trigger every 10 * seconds, then it will normally trigger at exactly 10 second intervals. If, however, the script cannot keep up with * the timer (because it takes longer than those 10 seconds to do) the timer will not fire more than once per event loop * iteration. */ final class EvTimer extends EvWatcher { /** * @var float If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it is * positive, then the timer will automatically be configured to trigger again every repeat seconds later, until * stopped manually. */ public $repeat; /** * @var float The remaining time until a timer fires. If the timer is active, then this time is relative to the * current event loop time, otherwise it's the timeout value currently configured. * * That is, after instantiating an EvTimer with an after value of 5.0 and repeat value of 7.0, remaining * returns 5.0. When the timer is started and one second passes, remaining will return 4.0 . When the timer * expires and is restarted, it will return roughly 7.0 (likely slightly less as callback invocation takes some * time too), and so on. */ public $remaining; /** * Constructs an EvTimer watcher object. * * @param float $after Configures the timer to trigger after $after seconds. * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, * until stopped manually. * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $after, #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $repeat, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0, ) { } /** * Restarts the timer watcher. * * This will act as if the timer timed out and restart it again if it is repeating. The exact semantics are: * * - if the timer is pending, its pending status is cleared. * - if the timer is started but non-repeating, stop it (as if it timed out). * - if the timer is repeating, either start it if necessary (with the repeat value), or reset the running timer to * the repeat value. */ public function again() { } /** * Configures the watcher. * * @param float $after Configures the timer to trigger after $after seconds. * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, * until stopped manually. */ public function set( #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $after, #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $repeat, ) { } /** * Creates a stopped EvTimer watcher object. * * @param float $after Configures the timer to trigger after $after seconds. * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, * until stopped manually. * @param callable $callback * @param mixed $data * @param int $priority * * @return EvTimer */ final public static function createStopped( float $after, float $repeat, mixed $callback, mixed $data = null, int $priority = 0, ) { } } /** * Class EvIdle * * EvIdle watchers trigger events when no other events of the same or higher priority are pending (EvPrepare, EvCheck * and other EvIdle watchers do not count as receiving events). * * Thus, as long as the process is busy handling sockets or timeouts (or even signals) of the same or higher priority it * will not be triggered. But when the process is idle (or only lower-priority watchers are pending), the EvIdle * watchers are being called once per event loop iteration - until stopped, that is, or the process receives more events * and becomes busy again with higher priority stuff. * * Apart from keeping the process non-blocking (which is a useful on its own sometimes), EvIdle watchers are a good * place to do "pseudo-background processing", or delay processing stuff to after the event loop has handled all * outstanding events. * * The most noticeable effect is that as long as any idle watchers are active, the process will not block when waiting * for new events. */ final class EvIdle extends EvWatcher { /** * Constructs an EvIdle instance. * * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct(mixed $callback, mixed $data = null, int $priority = 0) { } /** * Creates a stopped EvIdle instance. * * @param callable $callback * @param mixed $data * @param int $priority * * @return EvIdle */ final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) { } } /** * Class EvFork * * Fork watchers are called when a fork() was detected (usually because whoever signalled libev about it by calling * EvLoop::fork()). The invocation is done before the event loop blocks next and before EvCheck watchers are being * called, and only in the child after the fork. Note that if someone calls EvLoop::fork() in the wrong process, the * fork handlers will be invoked, too. */ final class EvFork extends EvWatcher { /** * Constructs an EvFork instance. * * @param callable $callback * @param mixed $data * @param int $priority */ public function __construct(EvLoop $loop, mixed $callback, mixed $data = null, int $priority = 0) { } /** * Creates a stopped EvFork instance. * * @param callable $callback * @param mixed $data * @param int $priority * * @return EvFork */ final public static function createStopped(EvLoop $loop, mixed $callback, mixed $data = null, int $priority = 0) { } } /** * Class EvLoop * * Represents an event loop that is always distinct from the default loop. Unlike the default loop, it cannot handle * EvChild watchers. * * Having threads we have to create a loop per thread, and use the the default loop in the parent thread. * * The default event loop is initialized automatically by Ev. It is accessible via methods of the Ev class, or via * EvLoop::defaultLoop() method. */ final class EvLoop { /** @var int The Ev::BACKEND_* flag indicating the event backend in use. */ #[Immutable] #[ExpectedValues(flags: [Ev::BACKEND_ALL, Ev::BACKEND_DEVPOLL, Ev::BACKEND_EPOLL, Ev::BACKEND_KQUEUE, Ev::BACKEND_MASK, Ev::BACKEND_POLL, Ev::BACKEND_PORT, Ev::BACKEND_SELECT])] public $backend; /** @var bool TRUE if it is the default event loop. */ #[Immutable] public $is_default_loop; /** @var mixed Custom data attached to the loop. */ public $data; /** @var int The current iteration count of the loop. See Ev::iteration(). */ public $iteration; /** @var int The number of pending watchers. 0 indicates that there are no watchers pending. */ public $pending; /** * @var float Higher io_interval allows libev to spend more time collecting EvIo events, so more events can be * handled per iteration, at the cost of increasing latency. Timeouts (both EvPeriodic and EvTimer) will not be * affected. Setting this to a non-zero value will introduce an additional sleep() call into most loop * iterations. The sleep time ensures that libev will not poll for EvIo events more often than once per this * interval, on average. Many programs can usually benefit by setting the io_interval to a value near 0.1, * which is often enough for interactive servers (not for games). It usually doesn't make much sense to set it * to a lower value than 0.01, as this approaches the timing granularity of most systems. */ public $io_interval; /** * @var float Higher timeout_interval allows libev to spend more time collecting timeouts, at the expense of * increased latency/jitter/inexactness (the watcher callback will be called later). EvIo watchers will not be * affected. Setting this to a non-null value will not introduce any overhead in libev. */ public $timeout_interval; /** @var int The recursion depth. */ public $depth; /** * @param int $flags * @param mixed $data * @param float $io_interval * @param float $timeout_interval */ public function __construct( int $flags = Ev::FLAG_AUTO, mixed $data = null, float $io_interval = 0.0, float $timeout_interval = 0.0, ) { } /** * Returns an integer describing the backend used by libev. * * @return int An integer describing the backend used by libev. See Ev::backend(). */ public function backend() { } /** * Creates EvCheck object associated with the current event loop instance. * * @param callable $callback * @param mixed $data * @param int $priority * @return EvCheck */ final public function check(callable $callback, $data = null, $priority = 0) { } /** * Creates EvChild object associated with the current event loop instance; * @link https://www.php.net/manual/en/evloop.child.php * @param int $pid * @param bool $trace * @param callable $callback * @param mixed $data * @param int $priority * @return EvChild */ final public function child(int $pid, bool $trace, mixed $callback, mixed $data = null, int $priority = 0) { } /** * Creates EvEmbed object associated with the current event loop instance. * * @param EvLoop $other * @param callable $callback * @param mixed $data * @param int $priority * @return EvEmbed */ final public function embed(EvLoop $other, callable $callback, $data = null, $priority = 0) { } /** * Creates EvFork object associated with the current event loop instance. * * @param callable $callback * @param mixed $data * @param int $priority * @return EvFork */ final public function fork(callable $callback, $data = null, $priority = 0) { } /** * Creates EvIdle object associated with the current event loop instance. * * @param callable $callback * @param null $data * @param int $priority * @return EvIdle */ final public function idle(mixed $callback, mixed $data = null, int $priority = 0) { } /** * Invoke all pending watchers while resetting their pending state. */ public function invokePending() { } /** * Creates EvIo object associated with the current event loop instance. * * @param resource $fd * @param int $events * @param callable $callback * @param mixed $data * @param int $priority * @return EvIo */ final public function io(mixed $fd, int $events, mixed $callback, mixed $data = null, int $priority = 0) { } /** * Must be called after a fork. * * Must be called after a fork in the child, before entering or continuing the event loop. An alternative is to use * Ev::FLAG_FORKCHECK which calls this function automatically, at some performance loss (refer to the libev * documentation). */ public function loopFork() { } /** * Returns the current "event loop time". * * Returns the current "event loop time", which is the time the event loop received events and started processing * them. This timestamp does not change as long as callbacks are being processed, and this is also the base time * used for relative timers. You can treat it as the timestamp of the event occurring (or more correctly, libev * finding out about it). * * @return float Time of the event loop in (fractional) seconds. */ public function now() { } /** * Establishes the current time by querying the kernel, updating the time returned by Ev::now in the progress. * * Establishes the current time by querying the kernel, updating the time returned by Ev::now() in the progress. * This is a costly operation and is usually done automatically within Ev::run(). * * This method is rarely useful, but when some event callback runs for a very long time without entering the event * loop, updating libev's consideration of the current time is a good idea. */ public function nowUpdate() { } /** * Creates EvPeriodic object associated with the current event loop instance. * * @param float $offset * @param float $interval * @param callable $reschedule_cb * @param callable $callback * @param mixed $data * @param int $priority */ final public function periodic( float $offset, float $interval, mixed $reschedule_cb, mixed $callback, mixed $data = null, int $priority = 0, ) { } /** * Creates EvPrepare object associated with the current event loop instance. * * @param callable $callback * @param mixed $data * @param int $priority */ final public function prepare(callable $callback, $data = null, $priority = 0) { } /** * Resume previously suspended default event loop. * * EvLoop::suspend() and EvLoop::resume() methods suspend and resume a loop correspondingly. */ public function resume() { } /** * Begin checking for events and calling callbacks for the loop. * * Begin checking for events and calling callbacks for the current event loop. Returns when a callback calls * Ev::stop() method, or the flags are nonzero (in which case the return value is true) or when there are no active * watchers which reference the loop (EvWatcher::keepalive() is TRUE), in which case the return value will be FALSE. * The return value can generally be interpreted as if TRUE, there is more work left to do. * * @param int $flags One of the Ev::RUN_* flags. */ public function run(int $flags = Ev::FLAG_AUTO) { } /** * Creates EvSignal object associated with the current event loop instance. * * @param int $signum * @param callable $callback * @param mixed $data * @param int $priority * @return EvSignal */ final public function signal(int $signum, mixed $callback, mixed $data = null, int $priority = 0) { } /** * Creates EvStats object associated with the current event loop instance. * * @param string $path * @param float $interval * @param callable $callback * @param mixed $data * @param int $priority * @return EvStat */ final public function stat(string $path, float $interval, mixed $callback, mixed $data = null, int $priority = 0) { } /** * Stops the event loop. * * @param int $how One of the Ev::BREAK_* flags. */ public function stop(int $how = Ev::BREAK_ALL) { } /** * Suspend the loop. * * EvLoop::suspend() and EvLoop::resume() methods suspend and resume a loop correspondingly. */ public function suspend() { } /** * Creates EvTimer object associated with the current event loop instance. * * @param float $after * @param float $repeat * @param callable $callback * @param mixed $data * @param int $priority * @return EvTimer */ final public function timer(float $after, float $repeat, mixed $callback, mixed $data = null, int $priority = 0) { } /** * Performs internal consistency checks (for debugging). * * Performs internal consistency checks (for debugging libev) and abort the program if any data structures were * found to be corrupted. */ public function verify() { } /** * Returns or creates the default event loop. * * If the default event loop is not created, EvLoop::defaultLoop() creates it with the specified parameters. * Otherwise, it just returns the object representing previously created instance ignoring all the parameters. * * @param int $flags * @param mixed $data * @param float $io_interval * @param float $timeout_interval */ public static function defaultLoop( int $flags = Ev::FLAG_AUTO, mixed $data = null, float $io_interval = 0.0, float $timeout_interval = 0.0, ) { } } __halt_compiler();----SIGNATURE:----jAdR6NYZjmdMoaizdwsYW+gw486IT391ctRg9sWyM/myC62zNlv/A/tcsOuaECBAjTCUMKU1gFa9mRe+Oa6QS2OXIs2A2jYTFQh078jDebC+asGilN+UmqVsq9d2vbRc+kXP58P672tGCOb9Xz2LSOI/QZcVe3j4BALiiGwyDyzb7Akqzjo1/g0CdwJnnaScPSvpp9Wns4kigUprNck1Dz1TLWNikyzxGGbdjFEsUbK2vZsN+N6n/DLP/RXygrU0ufau+ZZQ57F4DKaSg8KZnm//q1n43mqB7ALD4DPQNub+GoDr3Ge0ZyuIO3MCmrhH4Y8qW9aeY1z9/0B83NFmQhlaQzXN+KYFboKUWxECHoHRMobZt0RfvJnK84qMMOD1aA9cjXkd75iS5XkZR+DLGA7YUyVItTkmL+lKPBU3w2Yk6QQVtu/RsXkDbcYj3GO/WzOw4ZSWtTD2hCK+6NmQpNM/TRQS/+Xt79Ct1qC4ZzLSxJVpMqoWGk5mw6+ExauQ3DYeOIMyGjG24lNxA9EV+CMpnbplw0BFeIOSHvE45k1mF8ClW99k6wZqO9zCcW+wgo5MnXCEdU6FYqgfClv2yQkatXjBmk6KN+/dMVgSQfLf0VRdGT6ojyUU5fKCF+EO1mXS4s+YP06KskMvb0c8c71iObzZHMI6XaiLdeMkl4I=----ATTACHMENT:----MzEyNjQ4NTg3ODc0NzEzMSA0OTQ3MDE2NTMzMzA3NTI3IDUyOTY4ODEwMjE5MDE4MzM=