php教程

MongoPool::getSize

(PECL mongo >= 1.2.3)

MongoPool::getSizeGet pool size for connection pools

说明

public static MongoPool::getSize ( void ) : int

参数

此函数没有参数。

返回值

Returns the current pool size.

更新日志

版本 说明
1.2.11 Emits E_DEPRECATED when used.

范例

Example #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: ".MongoPool::getSize()."\n";

echo 
"setting pool size to 200\n";

MongoPool::setSize(200);

// pool size is 200
echo "pool size is: ".MongoPool::getSize()."\n";

$conn2 = new Mongo("host2");

// remaining for host1 is -2
// remaining for host2 is 199
var_dump(Mongo::poolDebug());

?>

参见

User Contributed Notes

There are no user contributed notes for this page.

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788