GoLang MongoPool::getSize

request it (382)
GoLang replacement for PHP's MongoPool::getSize [edit | history]



Do you know a GoLang replacement for PHP's MongoPool::getSize? Write it!

PHP MongoPool::getSize

PHP original manual for MongoPool::getSize [ show | php.net ]

MongoPool::getSize

(PECL mongo >= 1.2.3)

MongoPool::getSizeGet pool size for connection pools

Description

public static int MongoPool::getSize ( void )

Parameters

This function has no parameters.

Return Values

Returns the current pool size.

Changelog

Version Description
1.2.11 Emits E_DEPRECATED when used.

Examples

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());

?>

See Also