|
...
|
...
|
@@ -7,15 +7,15 @@ use Swoole\Database\RedisPool; |
|
|
|
class RedisCli
|
|
|
|
{
|
|
|
|
private $pool;
|
|
|
|
public function __construct($host,$port,$password,$dbIndex, $timeout=0, $num = 20)
|
|
|
|
public function __construct($host,$port,$password,$dbIndex, $num = 20)
|
|
|
|
{
|
|
|
|
$this->pool = new RedisPool((new RedisConfig)
|
|
|
|
->withHost($host)
|
|
|
|
->withPort($port)
|
|
|
|
->withAuth($password)
|
|
|
|
->withDbIndex($dbIndex)
|
|
|
|
->withTimeout($timeout)
|
|
|
|
->withReadTimeout($timeout)
|
|
|
|
// ->withTimeout($timeout)
|
|
|
|
// ->withReadTimeout($timeout)
|
|
|
|
,$num //默认64个连接池
|
|
|
|
);
|
|
|
|
}
|
...
|
...
|
|