Get pool size for connection pools
public getPoolSize ( ) : integer | ||
return | integer | Returns the current pool size. |
public function testPoolSize() { $this->assertEquals(Mongo::getPoolSize(), -1); Mongo::setPoolSize(4.1); $this->assertEquals(Mongo::getPoolSize(), 4); Mongo::setPoolSize(0); $thrown = false; try { $m = new Mongo("mongodb://localhost:20000"); } catch (MongoException $e) { $this->assertStringEndsWith("pool", $e->getMessage()); $thrown = true; } $this->assertTrue($thrown); Mongo::setPoolSize(-1); }