Mongo::getPoolSize
(PECL mongo >=1.2.0)
Mongo::getPoolSize — Get pool size for connection pools
Описание
public static int Mongo::getPoolSize
( void
)
Внимание
This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::getSize() instead.
Список параметров
У этой функции нет параметров.
Возвращаемые значения
Returns the current pool size.
Список изменений
Версия | Описание |
---|---|
1.2.11 | Emits E_DEPRECATED when used. |
Примеры
Пример #1 Changing pool size
This returns the default pool size, sets a new pool size, then prints the new pool size and the pool debugging information. Note that changing the pool size only affects new connection pools, it does not change old ones.
<?php
$connection = new Mongo("host1");
// pool size is -1
echo "pool size is: ".Mongo::getPoolSize()."\n";
echo "setting pool size to 200\n";
Mongo::setPoolSize(200);
// pool size is 200
echo "pool size is: ".Mongo::getPoolSize()."\n";
$conn2 = new Mongo("host2");
// remaining for host1 is -2
// remaining for host2 is 199
var_dump(Mongo::poolDebug());
?>
Смотрите также
- Mongo::setPoolSize() - Set the size for future connection pools.
- Mongo::poolDebug() - Returns information about all connection pools.
- The connection documentation.
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с базами данных
- Расширения для работы с базами данных отдельных производителей
- MongoDB
- Дополнительно
- Функция Mongo::connectUtil() - Connects with a database server
- Функция Mongo::__construct() - The __construct purpose
- Функция Mongo::getPoolSize() - Get pool size for connection pools
- Функция Mongo::getSlave() - Returns the address being used by this for slaveOkay reads
- Функция Mongo::getSlaveOkay() - Get slaveOkay setting for this connection
- Функция Mongo::poolDebug() - Returns information about all connection pools.
- Функция Mongo::setPoolSize() - Set the size for future connection pools.
- Функция Mongo::setSlaveOkay() - Change slaveOkay setting for this connection
- Функция Mongo::switchSlave() - Choose a new secondary for slaveOkay reads
Коментарии
404 Not Found