Permalink
Browse files

document timeout

  • Loading branch information...
1 parent 95390fe commit 49db04b2dd937fead37f840cb6f7ae27e958c324 @bkw bkw committed Dec 4, 2012
Showing with 181 additions and 0 deletions.
  1. +5 −0 amqpconnection/construct.xml
  2. +56 −0 amqpconnection/gettimeout.xml
  3. +113 −0 amqpconnection/settimeout.xml
  4. +7 −0 ini.xml
@@ -65,6 +65,11 @@
<entry>Password <note><simpara>Max 128 characters</simpara></note></entry>
<entry><link linkend="ini.amqp.password">amqp.password</link></entry>
</row>
+ <row>
+ <entry><emphasis>timeout</emphasis></entry>
+ <entry>Inactivity timout to use for this connection</entry>
+ <entry><link linkend="ini.amqp.timeout">amqp.timeout</link></entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+
+<refentry xml:id="amqpconnection.gettimeout" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>AMQPConnection::getTimeout</refname>
+ <refpurpose>Get the configured timeout</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <modifier>public</modifier> <type>float</type><methodname>AMQPConnection::getTimeout</methodname>
+ <void />
+ </methodsynopsis>
+ <para>
+ Get the configured timeout.
+ </para>
+
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ &no.function.parameters;
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ The configured timeout as a float.
+ </para>
+ </refsect1>
+
+
+</refentry>
+
+<!-- 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
+-->
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+
+<refentry xml:id="amqpconnection.settimeout" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+ <refname>AMQPConnection::setTimeout</refname>
+ <refpurpose>Set the inactivity timeout on this connection.</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <modifier>public</modifier> <type>bool</type><methodname>AMQPConnection::setTimeout</methodname>
+ <methodparam><type>float</type><parameter>timeout</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ This method will set the timeout value used to connect to the AMQP broker.
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>timeout</parameter></term>
+ <listitem>
+ <para>
+ The timeout in (possibly fractional) seconds.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+
+ <refsect1 role="errors">
+ &reftitle.errors;
+ <para>
+ Throws an <classname>AMQPConnectionException</classname> if
+ the specified timeout was negative.
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><methodname>AMQPConnection::setTimeout</methodname> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+/* Create a new connection */
+$cnn = new AMQPConnection();
+
+// set the timeout
+$cnn->setTimeout(0.5);
+
+$ch = new AMQPChannel($cnn);
+$q = new AMQPQueue($ch);
+$q->setName('queue1');
+
+function processMessage(AMQPEnvelope $env, AMQPQueue $queue) {
+ doSomething($env->getBody());
+ $queue->ack($env->getDeliveryTag());
+ return true;
+}
+
+$consumerTag = uniqid();
+// Start listening for messages
+$q->consume('processMessage', AMQP_NOPARAM, $consumerTag);
+
+// timeout reached, cancel subscription:
+$q->cancel($consumerTag);
+
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+
+
+</refentry>
+
+<!-- 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
+-->
View
@@ -48,6 +48,13 @@
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
+ <entry><link linkend="ini.amqp.timeout">amqp.timeout</link></entry>
+ <entry>0</entry>
+ <entry>PHP_INI_ALL</entry>
+ <entry><!-- leave empty, this will be filled by an automatic script --></entry>
+ </row>
+
+ <row>
<entry>amqp.auto_ack</entry>
<entry>0</entry>
<entry>PHP_INI_ALL</entry>

0 comments on commit 49db04b

Please sign in to comment.