Mongo::getPoolSize

(PECL mongo >=1.2.0)

Mongo::getPoolSizeGet pool size for connection pools

说锟斤拷

public static Mongo::getPoolSize ( void ) : int
Warning

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.

锟斤拷锟斤拷

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: ".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());

?>

锟轿硷拷