mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-29 23:38:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@331229 c90b9560-bf6c-de11-be94-00142212c4b1
235 lines
7.1 KiB
XML
235 lines
7.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<phpdoc:classref xml:id="class.eventbase" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
<title>The EventBase class</title>
|
|
<titleabbrev>EventBase</titleabbrev>
|
|
<partintro>
|
|
<!-- {{{ EventBase intro -->
|
|
<section xml:id="eventbase.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
<classname>EventBase</classname>
|
|
class represents libevent's event base structure. It holds a set of events
|
|
and can poll to determine which events are active.
|
|
</para>
|
|
<para>
|
|
Each event base has a
|
|
<emphasis>method</emphasis>
|
|
, or a
|
|
<emphasis>backend</emphasis>
|
|
that it uses to determine which events are ready. The recognized methods
|
|
are:
|
|
<literal>select</literal>
|
|
,
|
|
<literal>poll</literal>
|
|
,
|
|
<literal>epoll</literal>
|
|
,
|
|
<literal>kqueue</literal>
|
|
,
|
|
<literal>devpoll</literal>
|
|
,
|
|
<literal>evport</literal>
|
|
and
|
|
<literal>win32</literal>
|
|
.
|
|
</para>
|
|
<para>
|
|
To configure event base to use, or avoid specific backend
|
|
<classname>EventConfig</classname>
|
|
class can be used.
|
|
</para>
|
|
<warning xml:id="eventbase.object-dtor-warning">
|
|
<para>
|
|
Do
|
|
<emphasis>NOT</emphasis>
|
|
destroy the
|
|
<classname>EventBase</classname>
|
|
object as long as resources of the associated
|
|
<literal>Event</literal>
|
|
objects are not released. Otherwise, it will lead to unpredictable
|
|
results!
|
|
</para>
|
|
</warning>
|
|
</section>
|
|
<!-- }}} -->
|
|
<section xml:id="eventbase.synopsis">
|
|
&reftitle.classsynopsis;
|
|
|
|
<!-- {{{ Synopsis -->
|
|
<classsynopsis>
|
|
<ooclass>
|
|
<classname>EventBase</classname>
|
|
</ooclass>
|
|
<!-- {{{ Class synopsis -->
|
|
<classsynopsisinfo>
|
|
<ooclass>
|
|
<modifier>final</modifier>
|
|
<classname>EventBase</classname>
|
|
</ooclass>
|
|
</classsynopsisinfo>
|
|
<!-- }}} -->
|
|
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>integer</type>
|
|
<varname linkend="eventbase.constants.loop-once">EventBase::LOOP_ONCE</varname>
|
|
<initializer>1</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>integer</type>
|
|
<varname linkend="eventbase.constants.loop-nonblock">EventBase::LOOP_NONBLOCK</varname>
|
|
<initializer>2</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>integer</type>
|
|
<varname linkend="eventbase.constants.nolock">EventBase::NOLOCK</varname>
|
|
<initializer>1</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>integer</type>
|
|
<varname linkend="eventbase.constants.startup-iocp">EventBase::STARTUP_IOCP</varname>
|
|
<initializer>4</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>integer</type>
|
|
<varname linkend="eventbase.constants.no-cache-time">EventBase::NO_CACHE_TIME</varname>
|
|
<initializer>8</initializer>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>const</modifier>
|
|
<type>integer</type>
|
|
<varname linkend="eventbase.constants.epoll-use-changelist">EventBase::EPOLL_USE_CHANGELIST</varname>
|
|
<initializer>16</initializer>
|
|
</fieldsynopsis>
|
|
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
|
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.eventbase')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
|
</classsynopsis>
|
|
<!-- }}} -->
|
|
</section>
|
|
<!-- {{{ EventBase constants -->
|
|
<section xml:id="eventbase.constants">
|
|
&reftitle.constants;
|
|
<variablelist>
|
|
<varlistentry xml:id="eventbase.constants.loop-once">
|
|
<term>
|
|
<constant>EventBase::LOOP_ONCE</constant>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Flag used with
|
|
<methodname>EventBase::loop</methodname>
|
|
method which means: "block until libevent has an active event, then
|
|
exit once all active events have had their callbacks run".
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="eventbase.constants.loop-nonblock">
|
|
<term>
|
|
<constant>EventBase::LOOP_NONBLOCK</constant>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Flag used with
|
|
<methodname>EventBase::loop</methodname>
|
|
method which means: "do not block: see which events are ready now, run
|
|
the callbacks of the highest-priority ones, then exit".
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="eventbase.constants.nolock">
|
|
<term>
|
|
<constant>EventBase::NOLOCK</constant>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Configuration flag. Do not allocate a lock for the event base, even if
|
|
we have locking set up".
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="eventbase.constants.startup-iocp">
|
|
<term>
|
|
<constant>EventBase::STARTUP_IOCP</constant>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Windows-only configuration flag. Enables the IOCP dispatcher at
|
|
startup.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="eventbase.constants.no-cache-time">
|
|
<term>
|
|
<constant>EventBase::NO_CACHE_TIME</constant>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Configuration flag. Instead of checking the current time every time the
|
|
event loop is ready to run timeout callbacks, check after each timeout
|
|
callback.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="eventbase.constants.epoll-use-changelist">
|
|
<term>
|
|
<constant>EventBase::EPOLL_USE_CHANGELIST</constant>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
If we are using the
|
|
<literal>epoll</literal>
|
|
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.
|
|
</para>
|
|
<para>
|
|
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.
|
|
</para>
|
|
<para>
|
|
This flag can also be activated by settnig the
|
|
<literal>EVENT_EPOLL_USE_CHANGELIST</literal>
|
|
environment variable.
|
|
</para>
|
|
<para>
|
|
This flag has no effect if one winds up using a backend other than
|
|
<literal>epoll</literal>
|
|
.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</section>
|
|
<!-- }}} -->
|
|
</partintro>
|
|
|
|
&reference.event.entities.eventbase;
|
|
|
|
</phpdoc:classref>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|