|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <!-- $Revision$ --> |
3 | | -<!-- EN-Revision: e2f2172bf114599926878017ab2dce356956fa9e Maintainer: lacatoire Status: ready --> |
| 3 | +<!-- EN-Revision: c50df321d2cccb1044219a98d4c5c7677d4b29cf Maintainer: lacatoire Status: ready --> |
4 | 4 | <!-- Reviewed: no --> |
5 | 5 |
|
6 | 6 | <refentry xml:id="yar-concurrent-client.call" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> |
|
23 | 23 | <para> |
24 | 24 | Enregistre un appel RPC, mais ne l'envoie pas immédiatement ; il sera |
25 | 25 | envoyé pendant l'appel à la méthode |
26 | | - <methodname>Yar_Concurrent_Client::loop</methodname> |
| 26 | + <methodname>Yar_Concurrent_Client::loop</methodname>. |
27 | 27 | </para> |
28 | 28 | </refsect1> |
29 | 29 |
|
|
34 | 34 | <term><parameter>uri</parameter></term> |
35 | 35 | <listitem> |
36 | 36 | <para> |
37 | | - L'URI du serveur RPC (http, tcp) |
| 37 | + L'URI du serveur RPC (HTTP, TCP). |
38 | 38 | </para> |
39 | 39 | </listitem> |
40 | 40 | </varlistentry> |
41 | 41 | <varlistentry> |
42 | 42 | <term><parameter>method</parameter></term> |
43 | 43 | <listitem> |
44 | 44 | <para> |
45 | | - Nom du service (i.e. le nom de la méthode) |
| 45 | + Nom du service (i.e. le nom de la méthode). |
46 | 46 | </para> |
47 | 47 | </listitem> |
48 | 48 | </varlistentry> |
49 | 49 | <varlistentry> |
50 | 50 | <term><parameter>parameters</parameter></term> |
51 | 51 | <listitem> |
52 | 52 | <para> |
53 | | - Paramètres |
| 53 | + Paramètres. |
54 | 54 | </para> |
55 | 55 | </listitem> |
56 | 56 | </varlistentry> |
|
62 | 62 | </para> |
63 | 63 | </listitem> |
64 | 64 | </varlistentry> |
| 65 | + <varlistentry> |
| 66 | + <term><parameter>error_callback</parameter></term> |
| 67 | + <listitem> |
| 68 | + <simpara> |
| 69 | + Si cette fonction de rappel est définie, alors Yar l'appellera lorsqu'une erreur surviendra. |
| 70 | + </simpara> |
| 71 | + </listitem> |
| 72 | + </varlistentry> |
| 73 | + <varlistentry> |
| 74 | + <term><parameter>options</parameter></term> |
| 75 | + <listitem> |
| 76 | + <simpara> |
| 77 | + Un &array; d'options. |
| 78 | + Voir la liste des <link linkend="yar.constants">constantes</link>. |
| 79 | + </simpara> |
| 80 | + </listitem> |
| 81 | + </varlistentry> |
65 | 82 | </variablelist> |
66 | 83 | </refsect1> |
67 | 84 |
|
68 | 85 | <refsect1 role="returnvalues"> |
69 | 86 | &reftitle.returnvalues; |
70 | | - <para> |
| 87 | + <simpara> |
71 | 88 | Un ID unique ; peut être utilisé pour identifier l'appel. |
72 | | - </para> |
| 89 | + </simpara> |
73 | 90 | </refsect1> |
74 | 91 |
|
75 | 92 | <refsect1 role="examples"> |
76 | 93 | &reftitle.examples; |
77 | | - <example> |
78 | | - <title>Exemple avec <function>Yar_Concurrent_Client::call</function></title> |
| 94 | + <informalexample> |
79 | 95 | <programlisting role="php"> |
80 | 96 | <![CDATA[ |
81 | 97 | <?php |
82 | | -function callback($retval, $callinfo) { |
83 | | - var_dump($retval); |
| 98 | +
|
| 99 | +function callback($retval, $callinfo) |
| 100 | +{ |
| 101 | + var_dump($retval); |
84 | 102 | } |
85 | 103 |
|
86 | | -function error_callback($type, $error, $callinfo) { |
| 104 | +function error_callback($type, $error, $callinfo) |
| 105 | +{ |
87 | 106 | error_log($error); |
88 | 107 | } |
89 | 108 |
|
90 | 109 | Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback"); |
91 | | -Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters")); // si la fonction de rappel n'est pas spécifiée, |
92 | | - // la fonction de rappel de la boucle sera utilisée |
| 110 | +
|
| 111 | +// Si la fonction de rappel n'est pas spécifiée, la fonction de rappel de la boucle sera utilisée |
| 112 | +Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters")); |
| 113 | +
|
| 114 | +// Ce serveur accepte le packager JSON |
93 | 115 | Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", NULL, array(YAR_OPT_PACKAGER => "json")); |
94 | | - // ce serveur accepte le packager json |
95 | | -Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", NULL, array(YAR_OPT_TIMEOUT=>1)); |
96 | | - // Délai d'attente maximal personnalisé |
97 | 116 |
|
98 | | -//Les requêtes ne sont pas envoyées pour le moment |
99 | | -?> |
| 117 | +// Délai d'attente maximal personnalisé |
| 118 | +Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", NULL, array(YAR_OPT_TIMEOUT => 1)); |
| 119 | +
|
| 120 | +// Les requêtes ne sont pas envoyées pour le moment |
100 | 121 | ]]> |
101 | 122 | </programlisting> |
102 | 123 | &example.outputs.similar; |
103 | 124 | <screen> |
104 | 125 | <![CDATA[ |
105 | 126 | ]]> |
106 | 127 | </screen> |
107 | | - </example> |
| 128 | + </informalexample> |
108 | 129 | </refsect1> |
109 | 130 |
|
110 | | - |
111 | 131 | <refsect1 role="seealso"> |
112 | 132 | &reftitle.seealso; |
113 | 133 | <simplelist> |
|
0 commit comments