PHP » GoLang |
login |
register |
about
|
GoLang Mongo::setPoolSize
request it (419)
GoLang replacement for PHP's Mongo::setPoolSize
[edit | history]
Mongo::setPoolSize(PECL mongo >=1.2.0) Mongo::setPoolSize — Set the size for future connection pools Description
public static bool Mongo::setPoolSize
( int
$size
)Warning
This method has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead. Sets the max number of connections new pools will be able to create. Parameters
Return ValuesReturns the former value of pool size. Examples
Example #1 Mongo::setPoolSize() example If you set the pool size to n and then create n connections, attempting to create an n+1st connection will throw a MongoConnectionException.
<?php The above example will output something similar to: 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 See Also
|
more
Recently updated
more
Most requested
more
Last requests
|