Files
kiri-core/System/Pool/Pool.php
T

46 lines
749 B
PHP
Raw Normal View History

2020-08-31 01:27:08 +08:00
<?php
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-08-31 01:27:08 +08:00
namespace Snowflake\Pool;
2021-01-12 18:13:02 +08:00
use Snowflake\Exception\ComponentException;
2020-08-31 01:27:08 +08:00
use Snowflake\Snowflake;
/**
* Class Pool
* @package Snowflake\Pool
2021-01-04 16:11:43 +08:00
* @property Redis $redis
* @property Connection $db
2020-09-03 15:23:11 +08:00
* @property $memcached
2020-08-31 01:27:08 +08:00
*/
class Pool extends \Snowflake\Abstracts\Pool
{
/**
2020-09-03 15:23:11 +08:00
* @return Redis
2021-01-12 18:13:02 +08:00
* @throws ComponentException
2020-08-31 01:27:08 +08:00
*/
2020-12-17 14:12:44 +08:00
public function getRedis(): Redis
2020-08-31 01:27:08 +08:00
{
2021-01-12 18:13:02 +08:00
return Snowflake::app()->get('redis_connections');
2020-08-31 01:27:08 +08:00
}
/**
* @return Connection
2021-01-12 18:13:02 +08:00
* @throws ComponentException
2020-08-31 01:27:08 +08:00
*/
2020-12-17 14:12:44 +08:00
public function getDb(): Connection
2020-08-31 01:27:08 +08:00
{
2021-01-12 18:13:02 +08:00
return Snowflake::app()->get('connections');
2020-08-31 01:27:08 +08:00
}
2020-09-03 15:23:11 +08:00
2021-02-22 17:44:24 +08:00
public function createClient(string $name, array $config): mixed
{
// TODO: Implement createClient() method.
return null;
}
2020-08-31 01:27:08 +08:00
}