Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ev(3) [php man page]

EV(3)									 1								     EV(3)

The Ev class

INTRODUCTION
Ev is a singleton providing access to the default loop and to some common operations. CLASS SYNOPSIS
Ev final Ev Constants o const integer$Ev::FLAG_AUTO0 o const integer$Ev::FLAG_NOENV16777216 o const integer$Ev::FLAG_FORKCHECK33554432 o const integer$Ev::FLAG_NOINOTIFY1048576 o const integer$Ev::FLAG_SIGNALFD2097152 o const integer$Ev::FLAG_NOSIGMASK4194304 o const integer$Ev::RUN_NOWAIT1 o const integer$Ev::RUN_ONCE2 o const integer$Ev::BREAK_CANCEL0 o const integer$Ev::BREAK_ONE1 o const integer$Ev::BREAK_ALL2 o const integer$Ev::MINPRI-2 o const integer$Ev::MAXPRI2 o const integer$Ev::READ1 o const integer$Ev::WRITE2 o const integer$Ev::TIMER256 o const integer$Ev::PERIODIC512 o const integer$Ev::SIGNAL1024 o const integer$Ev::CHILD2048 o const integer$Ev::STAT4096 o const integer$Ev::IDLE8192 o const integer$Ev::PREPARE16384 o const integer$Ev::CHECK32768 o const integer$Ev::EMBED65536 o const integer$Ev::CUSTOM16777216 o const integer$Ev::ERROR2147483648 o const integer$Ev::BACKEND_SELECT1 o const integer$Ev::BACKEND_POLL2 o const integer$Ev::BACKEND_EPOLL4 o const integer$Ev::BACKEND_KQUEUE8 o const integer$Ev::BACKEND_DEVPOLL16 o const integer$Ev::BACKEND_PORT32 o const integer$Ev::BACKEND_ALL63 o const integer$Ev::BACKEND_MASK65535 Methods o finalpublicstatic int Ev::backend (void ) o finalpublicstatic int Ev::depth (void ) o finalpublicstatic void Ev::embeddableBackends (void ) o finalpublicstatic void Ev::feedSignal (int $signum) o finalpublicstatic void Ev::feedSignalEvent (int $signum) o finalpublicstatic int Ev::iteration (void ) o finalpublicstatic double Ev::now (void ) o finalpublicstatic void Ev::nowUpdate (void ) o finalpublicstatic void Ev::recommendedBackends (void ) o finalpublicstatic void Ev::resume (void ) o finalpublicstatic void Ev::run ([int $flags]) o finalpublicstatic void Ev::sleep (double $seconds) o finalpublicstatic void Ev::stop ([int $how]) o finalpublicstatic void Ev::supportedBackends (void ) o finalpublicstatic void Ev::suspend (void ) o finalpublicstatic double Ev::time (void ) o finalpublicstatic void Ev::verify (void ) PREDEFINED CONSTANTS
Flags passed to create a loop: o Ev::FLAG_AUTO - The default flags value o Ev::FLAG_NOENV - If this flag used(or the program runs setuid or setgid), libev won't look at the environment variable $LIBEV_FLAGS . Otherwise(by default), $LIBEV_FLAGS will override the flags completely if it is found. Useful for performance tests and searching for bugs. o Ev::FLAG_FORKCHECK - Makes libev check for a fork in each iteration, instead of calling EvLoop::fork manually. This works by call- ing getpid() on every iteration of the loop, and thus this might slow down the event loop with lots of loop iterations, but usu- ally is not noticeable. This flag setting cannot be overridden or specified in the $LIBEV_FLAGS environment variable. o Ev::FLAG_NOINOTIFY - When this flag is specified, libev won't attempt to use the inotify API for its ev_stat watchers. The flag can be useful to conserve inotify file descriptors, as otherwise each loop using ev_stat watchers consumes one inotify handle. o Ev::FLAG_SIGNALFD - When this flag is specified, libev will attempt to use the signalfd API for its ev_signal (and ev_child ) watchers. This API delivers signals synchronously, which makes it both faster and might make it possible to get the queued signal data. It can also simplify signal handling with threads, as long as signals are properly blocked in threads. Signalfd will not be used by default. o Ev::FLAG_NOSIGMASK - When this flag is specified, libev will avoid to modify the signal mask. Specifically, this means having to make sure signals are unblocked before receiving them. This behaviour is useful for custom signal handling, or handling signals only in specific threads. Flags passed to Ev::run , or EvLoop::run o Ev::RUN_NOWAIT - Means that event loop will look for new events, will handle those events and any already outstanding ones, but will not wait and block the process in case there are no events and will return after one iteration of the loop. This is sometimes useful to poll and handle new events while doing lengthy calculations, to keep the program responsive. o Ev::RUN_ONCE - Means that event loop will look for new events (waiting if necessary) and will handle those and any already out- standing ones. It will block the process until at least one new event arrives (which could be an event internal to libev itself, so there is no guarantee that a user-registered callback will be called), and will return after one iteration of the loop. Flags passed to Ev::stop , or EvLoop::stop o Ev::BREAK_CANCEL - Cancel the break operation. o Ev::BREAK_ONE - Makes the innermost Ev::run (or EvLoop::run ) call return. o Ev::BREAK_ALL - Makes all nested Ev::run (or EvLoop::run ) calls return. Watcher priorities: o Ev::MINPRI - Minimum allowed watcher priority. o Ev::MAXPRI - Maximum allowed watcher priority. Bit masks of (received) events: o Ev::READ - The file descriptor in the EvIo watcher has become readable. o Ev::WRITE - The file descriptor in the EvIo watcher has become writable. o Ev::TIMER -EvTimer watcher has been timed out. o Ev::PERIODIC -EvPeriodic watcher has been timed out. o Ev::SIGNAL - A signal specified in EvSignal::__construct has been received. o Ev::CHILD - The $pid specified in EvChild::__construct has received a status change. o Ev::STAT - The path specified in EvStat watcher changed its attributes. o Ev::IDLE -EvIdle watcher works when there is nothing to do with other watchers. o Ev::PREPARE - All EvPrepare watchers are invoked just before Ev::run starts. Thus, EvPrepare watchers are the last watchers invoked before the event loop sleeps or polls for new events. o Ev::CHECK - All EvCheck watchers are queued just after Ev::run has gathered the new events, but before it queues any callbacks for any received events. Thus, EvCheck watchers will be invoked before any other watchers of the same or lower priority within an event loop iteration. o Ev::EMBED - The embedded event loop specified in the EvEmbed watcher needs attention. o Ev::CUSTOM - Not ever sent(or otherwise used) by libev itself, but can be freely used by libev users to signal watchers (e.g. via EvWatcher::feed ). o Ev::ERROR - An unspecified error has occurred, the watcher has been stopped. This might happen because the watcher could not be properly started because libev ran out of memory, a file descriptor was found to be closed or any other problem. Libev considers these application bugs. See also ANATOMY OF A WATCHER Backend flags: o Ev::BACKEND_SELECT - select(2) backend o Ev::BACKEND_POLL - poll(2) backend o Ev::BACKEND_EPOLL - Linux-specific epoll(7) backend for both pre- and post-2.6.9 kernels o Ev::BACKEND_KQUEUE - kqueue backend used on most BSD systems. EvEmbed watcher could be used to embed one loop(with kqueue backend) into another. For instance, one can try to create an event loop with kqueue backend and use it for sockets only. o Ev::BACKEND_DEVPOLL - Solaris 8 backend. This is not implemented yet. o Ev::BACKEND_PORT - Solaris 10 event port mechanism with a good scaling. o Ev::BACKEND_ALL - Try all backends(even currupted ones). It's not recommended to use it explicitly. Bitwise operators should be applied here(e.g. Ev::BACKEND_ALL & ~ Ev::BACKEND_KQUEUE ) Use Ev::recommendedBackends , or don't specify any backends at all. o Ev::BACKEND_MASK - Not a backend, but a mask to select all backend bits from $flags value to mask out any backends(e.g. when modi- fying the $LIBEV_FLAGS environment variable). Note For the default loop during module initialization phase Ev registers ev_loop_fork call by means of pthread_atfork (if available). Note There are methods providing access to the default event loop in Ev class(e.g. Ev::iteration , Ev::depth etc.) For custom loops (created with EvLoop::__construct ) these values may be accessed via corresponding properties and methods of the EvLoop class. The instance of the default event loop itself can be fetched by means of EvLoop::defaultLoop method. PHP Documentation Group EV(3)
Man Page