Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

evperiodic(3) [php man page]

EVPERIODIC(3)								 1							     EVPERIODIC(3)

The EvPeriodic class

INTRODUCTION
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 multi- ple 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). CLASS SYNOPSIS
EvPeriodic EvPeriodicextends EvWatcher Properties o public$offset o public$interval Inherited properties o public$is_active o public$data o public$is_pending o public$priority Methods o public void EvPeriodic::again (void ) o public double EvPeriodic::at (void ) o public EvPeriodic::__construct NULL (double $offset, string $interval, callable $reschedule_cb, callable $callback, [mixed $data], [int $priority]) o finalpublicstatic EvPeriodic EvPeriodic::createStopped NULL (double $offset, double $interval, callable $reschedule_cb, callable $callback, [mixed $data], [int $priority]) o public void EvPeriodic::set (double $offset, double $interval) Inherited methods o public int EvWatcher::clear (void ) o abstractpublic EvWatcher::__construct (void ) o public void EvWatcher::feed (int $revents) o public EvLoop EvWatcher::getLoop (void ) o public void EvWatcher::invoke (int $revents) o public bool EvWatcher::keepalive ([bool $value]) o public void EvWatcher::setCallback (callable $callback) o public void EvWatcher::start (void ) o public void EvWatcher::stop (void ) PROPERTIES
o $offset - When repeating, this contains the offset value, otherwise this is the absolute point in time(the offset value passed to EvPeri- odic::set , although libev might modify this value for better numerical stability). o $interval - The current interval value. Can be modified any time, but changes only take effect when the periodic timer fires or EvPeri- odic::again is being called. PHP Documentation Group EVPERIODIC(3)

Check Out this Related Man Page

EVLOOP(3)								 1								 EVLOOP(3)

The EvLoop class

INTRODUCTION
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 accessable via methods of the Ev class, or via EvLoop::defaultLoop method. CLASS SYNOPSIS
EvLoop final EvLoop Properties o public$data o public$backend o public$is_default_loop o public$iteration o public$pending o public$io_interval o public$timeout_interval o public$depth Methods o public int EvLoop::backend (void ) o finalpublic EvCheck EvLoop::check (string $callback, [string $data], [string $priority]) o finalpublic EvChild EvLoop::child (string $pid, string $trace, string $callback, [string $data], [string $priority]) o public EvLoop::__construct ([int $flags], [mixed $data = NULL], [double $io_interval = 0.0], [double $timeout_interval = 0.0]) o publicstatic EvLoop EvLoop::defaultLoop ([int $flags = Ev::FLAG_AUTO], [mixed $data = NULL], [double $io_interval = 0.], [double $timeout_interval = 0.]) o finalpublic EvEmbed EvLoop::embed (string $other, [string $callback], [string $data], [string $priority]) o finalpublic EvFork EvLoop::fork NULL (callable $callback, [mixed $data], [int $priority]) o finalpublic EvIdle EvLoop::idle NULL (callable $callback, [mixed $data], [int $priority]) o public void EvLoop::invokePending (void ) o finalpublic EvIo EvLoop::io NULL (mixed $fd, int $events, callable $callback, [mixed $data], [int $priority]) o public void EvLoop::loopFork (void ) o public double EvLoop::now (void ) o public void EvLoop::nowUpdate (void ) o finalpublic EvPeriodic EvLoop::periodic NULL (double $offset, double $interval, callable $callback, [mixed $data], [int $priority]) o finalpublic EvPrepare EvLoop::prepare NULL (callable $callback, [mixed $data], [int $priority]) o public void EvLoop::resume (void ) o public void EvLoop::run ([int $flags]) o finalpublic EvSignal EvLoop::signal NULL (int $signum, callable $callback, [mixed $data], [int $priority]) o finalpublic EvStat EvLoop::stat NULL (string $path, double $interval, callable $callback, [mixed $data], [int $priority]) o public void EvLoop::stop ([int $how]) o public void EvLoop::suspend (void ) o finalpublic EvTimer EvLoop::timer NULL (double $after, double $repeat, callable $callback, [mixed $data], [int $priority]) o public void EvLoop::verify (void ) PROPERTIES
o $data - Custom data attached to loop o $backend - Readonly . The backend flags indicating the event backend in use. o $is_default_loop - Readonly . TRUE if it is the default event loop. o $iteration - The current iteration count of the loop. See Ev::iteration o $pending - The number of pending watchers. 0 indicates that there are no watchers pending. o $io_interval - 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. See also FUNCTIONS CONTROLLING EVENT LOOPS . o $timeout_interval - Higher $timeout_interval allows libev to spend more time collecting timeouts, at the expense of increased latency/jitter/inex- actness(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 . See also FUNCTIONS CONTROLLING EVENT LOOPS . o $depth - The recursion depth. See Ev::depth . PHP Documentation Group EVLOOP(3)
Man Page