mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 08:22:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@328585 c90b9560-bf6c-de11-be94-00142212c4b1
147 lines
3.9 KiB
XML
147 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 2983ed9c5015b3bda27e2dafff947c8532093164 Maintainer: chuso Status: ready -->
|
|
<!-- Reviewed: yes Maintainer: seros -->
|
|
|
|
<refentry xml:id="mongopool.setsize" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>MongoPool::setSize</refname>
|
|
<refpurpose>Establece el tamaño de los nuevos agrupamientos de conexiones</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <modifier>static</modifier> <type>bool</type><methodname>MongoPool::setSize</methodname>
|
|
<methodparam><type>int</type><parameter>size</parameter></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
Establece el número máximo de conexiones que podrán crear los nuevos agrupamientos.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>size</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
El número máximo de conexiones que podrán crear los nuevos agrupamientos.
|
|
Un número negativo indica que el agrupamiento podrá generar un número infinito
|
|
de conexiones.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el valor del tamaño anterior del agrupamiento.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>1.2.11</entry>
|
|
<entry>Emite un error de nivel <constant>E_DEPRECATED</constant> cuando se usa.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="examples"><!-- {{{ -->
|
|
&reftitle.examples;
|
|
<para>
|
|
<example xml:id="mongopool.setpoolsize.example.basic"><!-- {{{ -->
|
|
<title>Ejemplo de <function>Mongo::setPoolSize</function></title>
|
|
<para>
|
|
Si se establece un tamaño de agrupamiento de <literal>n</literal> y se crean
|
|
<literal>n</literal> conexiones, al intentar crear la conexión
|
|
<literal>n+1</literal> se lanzará una excepción de tipo
|
|
<classname>MongoConnectionException</classname>.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// permitir solamente una conexión al servidor
|
|
MongoPool::setSize(1);
|
|
|
|
// crear una conexión a localhost:27017
|
|
$m1 = new Mongo();
|
|
|
|
// intentar crear una segunda conexión a localhost:27017
|
|
// puesto que sólo se permite una, se lanzará una excepción
|
|
$m2 = new Mongo();
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Fatal error: Uncaught exception 'MongoConnectionException' with message 'no more connections in pool' in /path/to/php/script.php:10
|
|
Stack trace:
|
|
#0 /path/to/php/script.php(10): Mongo->__construct()
|
|
#1 {main}
|
|
thrown in /path/to/php/script.php on line 10
|
|
]]>
|
|
</screen>
|
|
</example><!-- }}} -->
|
|
</para>
|
|
</refsect1><!-- }}} -->
|
|
|
|
|
|
<refsect1 role="seealso"><!-- {{{ -->
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>MongoPool::getSize</function></member>
|
|
<member><function>MongoPool::info</function></member>
|
|
<member>La documentación sobre <link linkend="mongo.connecting">conexiones</link>.</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
|
|
-->
|