(PECL ev >= 0.2.0)
Ev is a static class providing access to the default loop and to some common operations.
Flags passed to create a loop:
Ev::FLAG_AUTOEv::FLAG_NOENVlibev 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.Ev::FLAG_FORKCHECKgetpid() on every iteration of the loop, and thus this might slow down the event loop with lots of loop iterations, but usually is not noticeable. This flag setting cannot be overridden or specified in the LIBEV_FLAGS environment variable.Ev::FLAG_NOINOTIFYlibev 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.Ev::FLAG_SIGNALFDlibev 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.Ev::FLAG_NOSIGMASKlibev 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()
Ev::RUN_NOWAITEv::RUN_ONCEFlags passed to Ev::stop(), or EvLoop::stop()
Ev::BREAK_CANCELEv::BREAK_ONEEv::BREAK_ALLWatcher priorities:
Ev::MINPRIEv::MAXPRIBit masks of (received) events:
Ev::READEv::WRITEEv::TIMEREv::PERIODICEv::SIGNALEv::CHILDpid specified in EvChild::__construct() has received a status change.Ev::STATEv::IDLEEv::PREPAREEv::CHECKEv::EMBEDEv::CUSTOMlibev itself, but can be freely used by libev users to signal watchers (e.g. via EvWatcher::feed() ).Ev::ERRORlibev 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 WATCHERBackend flags:
Ev::BACKEND_SELECTselect(2) backendEv::BACKEND_POLLpoll(2) backendEv::BACKEND_EPOLLepoll(7) backend for both pre- and post-2.6.9 kernelsEv::BACKEND_KQUEUEkqueue 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.Ev::BACKEND_DEVPOLLEv::BACKEND_PORTEv::BACKEND_ALLEv::BACKEND_ALL & ~ Ev::BACKEND_KQUEUE) Use Ev::recommendedBackends(), or don't specify any backends at all.Ev::BACKEND_MASKflags value to mask out any backends(e.g. when modifying the LIBEV_FLAGS environment variable).Note: For the default loop during module initialization phase
Evregisters » ev_loop_fork call by means ofpthread_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.