Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

event(3) [php man page]

EVENT(3)								 1								  EVENT(3)

The Event class

INTRODUCTION
Event class represents and event firing on a file descriptor being ready to read from or write to; a file descriptor becoming ready to read from or write to(edge-triggered I/O only); a timeout expiring; a signal occuring; a user-triggered event. Every event is associated with EventBase . However, event will never fire until it is added (via Event::add ). An added event remains in pending state until the registered event occurs, thus turning it to active state. To handle events user may register a callback which is called when event becomes active. If event is configured persistent , it remains pending. If it is not persistent, it stops being pending when it's callback runs. Event::del method deletes event, thus making it non-pending. By means of Event::add method it could be added again. CLASS SYNOPSIS
Event final Event Constants o const integer$Event::ET32 o const integer$Event::PERSIST16 o const integer$Event::READ2 o const integer$Event::WRITE4 o const integer$Event::SIGNAL8 o const integer$Event::TIMEOUT1 Properties o publicreadonly bool$pending Methods o public bool Event::add ([double $timeout]) o public bool Event::addSignal ([double $timeout]) o public bool Event::addTimer ([double $timeout]) o public Event::__construct (EventBase $base, mixed $fd, int $what, callable $cb, [mixed $arg = NULL]) o public bool Event::del (void ) o public bool Event::delSignal (void ) o public bool Event::delTimer (void ) o public void Event::free (void ) o publicstatic array Event::getSupportedMethods (void ) o public bool Event::pending (int $flags) o public bool Event::set (EventBase $base, mixed $fd, [int $what], [callable $cb], [mixed $arg]) o public bool Event::setPriority (int $priority) o public bool Event::setTimer (EventBase $base, callable $cb, [mixed $arg]) o publicstatic Event Event::signal (EventBase $base, int $signum, callable $cb, [mixed $arg]) o publicstatic Event Event::timer (EventBase $base, callable $cb, [mixed $arg]) PROPERTIES
o $pending - Whether event is pending. See About event persistence . PREDEFINED CONSTANTS
o Event::ET - Indicates that the event should be edge-triggered, if the underlying event base backend supports edge-triggered events. This affects the semantics of Event::READ and Event::WRITE . o Event::PERSIST - Indicates that the event is persistent. See About event persistence . o Event::READ - This flag indicates an event that becomes active when the provided file descriptor(usually a stream resource, or socket) is ready for reading. o Event::WRITE - This flag indicates an event that becomes active when the provided file descriptor(usually a stream resource, or socket) is ready for reading. o Event::SIGNAL - Used to implement signal detection. See "Constructing signal events" below. o Event::TIMEOUT - This flag indicates an event that becomes active after a timeout elapses. The Event::TIMEOUT flag is ignored when constructing an event: one can either set a timeout when event is added , or not. It is set in the $what argument to the callback function when a timeout has occurred. PHP Documentation Group EVENT(3)

Check Out this Related Man Page

EVENTBASE(3)								 1							      EVENTBASE(3)

The EventBase class

INTRODUCTION
EventBase class represents libevent's event base structure. It holds a set of events and can poll to determine which events are active. Each event base has a method , or a backend that it uses to determine which events are ready. The recognized methods are: select , poll , epoll , kqueue , devpoll , evport and win32 . To configure event base to use, or avoid specific backend EventConfig class can be used. Warning Do NOT destroy the EventBase object as long as resources of the associated Event objects are not released. Otherwise, it will lead to unpredictable results! CLASS SYNOPSIS
EventBase final EventBase Constants o const integer$EventBase::LOOP_ONCE1 o const integer$EventBase::LOOP_NONBLOCK2 o const integer$EventBase::NOLOCK1 o const integer$EventBase::STARTUP_IOCP4 o const integer$EventBase::NO_CACHE_TIME8 o const integer$EventBase::EPOLL_USE_CHANGELIST16 Methods o public EventBase::__construct ([EventConfig $cfg]) o public void EventBase::dispatch (void ) o public bool EventBase::exit ([double $timeout]) o public void EventBase::free (void ) o public int EventBase::getFeatures (void ) o public string EventBase::getMethod ([EventConfig $cfg]) o public double EventBase::getTimeOfDayCached (void ) o public bool EventBase::gotExit (void ) o public bool EventBase::gotStop (void ) o public bool EventBase::loop ([int $flags]) o public bool EventBase::priorityInit (int $n_priorities) o public bool EventBase::reInit (void ) o public bool EventBase::stop (void ) PREDEFINED CONSTANTS
o EventBase::LOOP_ONCE - Flag used with EventBase::loop method which means: "block until libevent has an active event, then exit once all active events have had their callbacks run". o EventBase::LOOP_NONBLOCK - Flag used with EventBase::loop method which means: "do not block: see which events are ready now, run the callbacks of the highest-priority ones, then exit". o EventBase::NOLOCK - Configuration flag. Do not allocate a lock for the event base, even if we have locking set up". o EventBase::STARTUP_IOCP - Windows-only configuration flag. Enables the IOCP dispatcher at startup. o EventBase::NO_CACHE_TIME - Configuration flag. Instead of checking the current time every time the event loop is ready to run timeout callbacks, check after each timeout callback. o EventBase::EPOLL_USE_CHANGELIST - If we are using the epoll backend, this flag says that it is safe to use Libevent's internal change-list code to batch up adds and deletes in order to try to do as few syscalls as possible. Setting this flag can make code run faster, but it may trigger a Linux bug: it is not safe to use this flag if one has any fds cloned by dup(), or its variants. Doing so will produce strange and hard-to-diagnose bugs. This flag can also be activated by settnig the EVENT_EPOLL_USE_CHANGE- LIST environment variable. This flag has no effect if one winds up using a backend other than epoll . PHP Documentation Group EVENTBASE(3)
Man Page