swoole-framwork/pool/CoMySqlPool.php
2024-05-21 14:33:56 +08:00

22 lines
457 B
PHP

<?php
namespace baihand\pool;
class CoMySqlPool extends DBPool
{
public function __construct($min = 5, $max = 10)
{
parent::__construct($min, $max);
}
protected function newDB()
{
$mysql = new \Swoole\Coroutine\MySQL();
$mysql ->connect([
'host'=>'127.0.0.1',
'user'=>'root',
'password'=>'123456',
'database'=>'saiadmin'
]);
return $mysql;
}
}