mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329774 c90b9560-bf6c-de11-be94-00142212c4b1
161 lines
3.9 KiB
XML
161 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<chapter xml:id="eventbufferevent.about.callbacks" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<title>About buffer event callbacks</title>
|
|
<para>
|
|
An object of
|
|
<classname>EventBufferEvent</classname>
|
|
class represents a
|
|
<emphasis>buffer event</emphasis>
|
|
. The asynchronous nature of I/O performed by Libevent implies that a
|
|
socket(or other kind of file descriptor) is not always available. Event
|
|
invokes corresponding callbacks when the resource becomes available for
|
|
reading or writing, or when some event occurs(e.g. error, "end of line"
|
|
etc.).
|
|
</para>
|
|
<para>
|
|
Read and write callbacks should match the following prototype:
|
|
</para>
|
|
<methodsynopsis>
|
|
<type>void</type>
|
|
<methodname>callback</methodname>
|
|
<methodparam
|
|
choice="opt">
|
|
<type>EventBufferEvent</type>
|
|
<parameter>bev</parameter>
|
|
<initializer>&null;</initializer>
|
|
</methodparam>
|
|
<methodparam
|
|
choice="opt">
|
|
<type>mixed</type>
|
|
<parameter>arg</parameter>
|
|
<initializer>&null;</initializer>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>bev</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Associated
|
|
<classname>EventBufferEvent</classname>
|
|
object.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>arg</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Custom variable attached to all callbacks via
|
|
<methodname>EventBufferEvent::__construct</methodname>
|
|
, or
|
|
<methodname>EventBufferEvent::setCallbacks</methodname>
|
|
.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
<para>
|
|
Event callback should match the following prototype:
|
|
</para>
|
|
<methodsynopsis>
|
|
<type>void</type>
|
|
<methodname>callback</methodname>
|
|
<methodparam
|
|
choice="opt">
|
|
<type>EventBufferEvent</type>
|
|
<parameter>bev</parameter>
|
|
<initializer>&null;</initializer>
|
|
</methodparam>
|
|
<methodparam
|
|
choice="opt">
|
|
<type>int</type>
|
|
<parameter>events</parameter>
|
|
<initializer>0</initializer>
|
|
</methodparam>
|
|
<methodparam
|
|
choice="opt">
|
|
<type>mixed</type>
|
|
<parameter>arg</parameter>
|
|
<initializer>&null;</initializer>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>bev</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Associated
|
|
<classname>EventBufferEvent</classname>
|
|
object.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>events</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Bit mask of events:
|
|
<constant>EventBufferEvent::READING</constant>
|
|
,
|
|
<constant>EventBufferEvent::WRITING</constant>
|
|
,
|
|
<constant>EventBufferEvent::EOL</constant>
|
|
,
|
|
<constant>EventBufferEvent::ERROR</constant>
|
|
and
|
|
<constant>EventBufferEvent::TIMEOUT</constant>
|
|
. See
|
|
<link linkend="eventbufferevent.constants">EventBufferEvent constants</link>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>arg</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Custom variable attached to all callbacks via
|
|
<methodname>EventBufferEvent::__construct</methodname>
|
|
, or
|
|
<methodname>EventBufferEvent::setCallbacks</methodname>
|
|
.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</chapter>
|
|
<!-- 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
|
|
-->
|