Php/docs/mongopool.getsize

提供:Dev Guides
< Php
2020年12月14日 (月) 11:42時点におけるNotes (トーク | 投稿記録)による版 (autoload)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

MongoPool::getSize

(PECL mongo >= 1.2.3)

MongoPool::getSizeGet pool size for connection pools


説明

public static MongoPool::getSize ( ) : int

パラメータ

この関数にはパラメータはありません。


返り値

Returns the current pool size.


変更履歴

バージョン 説明
PECL mongo 1.2.11 Emits E_DEPRECATED when used.


例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 -1echo "pool size is: ".MongoPool::getSize()."\n";echo "setting pool size to 200\n";MongoPool::setSize(200);// pool size is 200echo "pool size is: ".MongoPool::getSize()."\n";$conn2 = new Mongo("host2");// remaining for host1 is -2// remaining for host2 is 199var_dump(Mongo::poolDebug());?>

参考