1
0
mirror of https://github.com/php/doc-fr.git synced 2026-03-24 07:02:06 +01:00
Files
archived-doc-fr/reference/ev/watcher-callbacks.xml
Louis-Arnaud 3823a2f469 Review some translation
i.e. → c.-à-d., e.g. → p. ex., accents sur majuscules (À, É, Ç),
ligatures (cœur, sœur, nœud, œuvre, manœuvres), accords genre/nombre,
conjugaisons, typos (verrouillage, milliseconde, aléatoire), etc.
2026-02-25 21:01:23 +01:00

90 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: b4fbf4434abeca44c58575ff3967e5640f7877d5 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="ev.watcher-callbacks">
<title>Les fonctions de rappel d'un Watcher</title>
<simpara>
Tous les watchers peuvent être actifs (en attente d'événements) ou inactifs
(en pause). Seuls les watchers actifs peuvent avoir leurs fonctions de rappel
d'appelées. Toutes les fonctions de rappel seront appelées avec au moins deux
arguments :
<parameter>watcher</parameter> - le watcher, et <parameter>revents</parameter>,
un masque d'événements reçus.
</simpara>
<simpara>
Les fonctions de rappel des watchers sont passées aux constructeurs des watchers
(une classe dérivée de <classname>EvWatcher</classname> -
<methodname>EvCheck::__construct</methodname>, <methodname>EvChild::__construct</methodname>
etc.). Une fonction de rappel d'un watcher doit correspondre au prototype suivant :
</simpara>
<methodsynopsis>
<type>void</type>
<methodname>callback</methodname>
<methodparam choice="opt">
<type>object</type>
<parameter>watcher</parameter>
<initializer>NULL</initializer>
</methodparam>
<methodparam choice="opt">
<type>int</type>
<parameter>revents</parameter>
<initializer>NULL</initializer>
</methodparam>
</methodsynopsis>
<variablelist>
<varlistentry>
<term>
<parameter>watcher</parameter>
</term>
<listitem>
<simpara>
L'instance du watcher (d'une classe étendant <classname>EvWatcher</classname>).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>revents</parameter>
</term>
<listitem>
<simpara>
<link linkend="ev.constants.watcher-revents">Un watcher recevant les événements</link>.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>
Chaque type de watcher a un octet d'associé dans
<parameter>revents</parameter>, aussi, on peut utiliser la même
fonction de rappel pour plusieurs watchers. Le masque d'événements
est nommé après le type, c.-à-d.
<classname>EvChild</classname> (ou <methodname>EvLoop::child</methodname>) définit
<constant>EV::CHILD</constant>, <classname>EvPrepare</classname> (ou
<methodname>EvLoop::prepare</methodname>) définit <constant>Ev::PREPARE</constant>,
<classname>EvPeriodic</classname> (ou <methodname>EvLoop::periodic</methodname>)
définit <constant>Ev::PERIODIC</constant> et ainsi de suite, avec comme exception les
événements I/O (qui peuvent définir à la fois les octets
<constant>Ev::READ</constant> et <constant>Ev::WRITE</constant>).
</simpara>
</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
-->