mirror of
https://github.com/php/doc-es.git
synced 2026-04-23 15:18:07 +02:00
91fb53d836
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@329328 c90b9560-bf6c-de11-be94-00142212c4b1
129 lines
3.5 KiB
XML
129 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: a8906b51eab890ea2684fc3781031b55c47d0142 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="mongocursor.tailable" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>MongoCursor::tailable</refname>
|
|
<refpurpose>Establece si este cursor se dejará abierto después de obtener los últimos resultados</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>MongoCursor</type><methodname>MongoCursor::tailable</methodname>
|
|
<methodparam choice="opt"><type>bool</type><parameter>tail</parameter><initializer>true</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Mongo posee una característica conocia como cursores de seguimiento ("tailable"),
|
|
que son similares al comando de Unix "tail -f".
|
|
</para>
|
|
<para>
|
|
"De seguimiento" significa que el cursor no se cierra al obtener los últimos datos. En su lugar,
|
|
el cursor marca la posición final del objeto. Se puede continuar usando el
|
|
cursor más tarde, desde donde estaba ubicado, si se recibieron más datos.
|
|
</para>
|
|
<para>
|
|
Como cualquie "cursor latente", el cursor podría no ser válido en algún punto; por
|
|
ejemplo, si el final del objeto al que hace referencia fue eliminado. Por lo tanto, se debería
|
|
preparado para reconsultar si el cursor está <function>MongoCursor::dead</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>tail</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
Si el cursor debería ser de seguimiento.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve este cursor.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Lanza una <classname>MongoCursorException</classname> si este cursor ha empezado a iterar.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Ejemplo de <function>MongoCursor::tailable</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$cursor = $collection->find()->tailable();
|
|
|
|
$resultados = array();
|
|
|
|
while (1) {
|
|
if (!$cursor->hasNext()) {
|
|
// we've read all the results, exit
|
|
if ($cursor->dead()) {
|
|
break;
|
|
}
|
|
// read all results so far, wait for more
|
|
sleep(10);
|
|
}
|
|
else {
|
|
$resultados[] = $cursor->getNext();
|
|
}
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
La documentación principal de MongoDB sobre <link xlink:href="&url.mongodb.dochub.tailable;">sursores de seguimiento</link>.
|
|
</para>
|
|
<para>
|
|
<simplelist>
|
|
<member><function>MongoCursor::awaitData</function></member>
|
|
</simplelist>
|
|
</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
|
|
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
|
|
-->
|