mirror of
https://github.com/php/doc-es.git
synced 2026-03-23 23:12:09 +01:00
140 lines
4.1 KiB
XML
140 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: a47dff201e3f65c07f6c84a535951632771cf72d Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="eventbufferevent.about.callbacks">
|
|
<title>Acerca de las funciones de retrollamada del buffer de eventos</title>
|
|
<para>
|
|
Un objeto de la clase <classname>EventBufferEvent</classname>
|
|
representa un <emphasis>buffer de eventos</emphasis>.
|
|
La naturaleza asíncrona de I/O realizada por Libevent implica que un socket
|
|
(o cualquier otro tipo de descriptor de ficheros) no siempre está disponible. Event invoca las funciones de retrollamada correspondientes cuando
|
|
el recurso se vuelve disponible para una lectura o una escritura,
|
|
o cuando ocurren eventos (i.e. un error, un fin de línea,
|
|
etc.).
|
|
</para>
|
|
<para>
|
|
Las funciones de retrollamada de lectura y escritura deben corresponder
|
|
al siguiente prototipo:
|
|
</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>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>bev</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Objeto <classname>EventBufferEvent</classname> asociado.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>arg</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Variable personalizada adjunta a todas las funciones de retrollamada
|
|
a través del método <methodname>EventBufferEvent::__construct</methodname>
|
|
o del método <methodname>EventBufferEvent::setCallbacks</methodname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
<para>
|
|
Una función de retrollamada de evento debe corresponder al siguiente prototipo:
|
|
</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>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>bev</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Objeto <classname>EventBufferEvent</classname> asociado.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>events</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Máscara de bits de eventos:
|
|
<constant>EventBufferEvent::READING</constant>,
|
|
<constant>EventBufferEvent::WRITING</constant>,
|
|
<constant>EventBufferEvent::EOL</constant>,
|
|
<constant>EventBufferEvent::ERROR</constant> y
|
|
<constant>EventBufferEvent::TIMEOUT</constant>. Ver las
|
|
<link linkend="eventbufferevent.constants">constantes EventBufferEvent</link>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>arg</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Variable personalizada adjunta a todas las funciones de retrollamada a través
|
|
del método <methodname>EventBufferEvent::__construct</methodname> o
|
|
del método <methodname>EventBufferEvent::setCallbacks</methodname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</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
|
|
-->
|