<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xml:id="mongocursorinterface.timeout" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>MongoCursorInterface::timeout</refname> <refpurpose>Sets a client-side timeout for this query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>abstract</modifier> <modifier>public</modifier> <type>MongoCursorInterface</type><methodname>MongoCursorInterface::timeout</methodname> <methodparam><type>int</type><parameter>ms</parameter></methodparam> </methodsynopsis> <para> A timeout can be set at any time and will affect subsequent data retrieval associated with this cursor, including fetching more results from the database. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <variablelist> <varlistentry> <term> <parameter>ms</parameter> </term> <listitem> <para> The number of milliseconds for the cursor to wait for a response. Use <literal>-1</literal> to wait forever. By default, the cursor will wait <varname>30000</varname> milliseconds (30 seconds). </para> </listitem> </varlistentry> </variablelist> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns this cursor. </para> </refsect1> <refsect1 role="errors"> &reftitle.errors; <para> Causes methods that fetch results to throw a <classname>MongoCursorTimeoutException</classname> if the data fetch takes longer than the specified number of milliseconds. </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member>The <literal>socketTimeoutMS</literal> option for <function>MongoClient::__construct</function></member> </simplelist> </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 -->