array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'class.event.php', 1 => 'Event', ), 'up' => array ( 0 => 'book.event.php', 1 => 'Event', ), 'prev' => array ( 0 => 'event.constructing.signal.events.php', 1 => 'Constructing signal events', ), 'next' => array ( 0 => 'event.add.php', 1 => 'Event::add', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/event/event.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.event.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL event >= 1.2.6-beta)
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 occurring; 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.
Whether event is pending. See About event persistence .
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
.
Event::PERSIST
Indicates that the event is persistent. See About event persistence .
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.
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.
Event::SIGNAL
Used to implement signal detection. See "Constructing signal events" below.
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.