💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
我们提供了Redis连接池,而这一切默认对你是透明的 配置 ``` 'cache'=>[ 'type'=>'redis', 'host' => 'redis', 'port' => 6379, 'password' => '', 'select' => 1, 'timeout' => 0, 'expire' => -1, 'persistent' => false, 'pool'=>['min'=>1, 'max'=>10, 'check'=>30, 'idle'=>30 ], ] ``` rapphp 会自动获取释放 RedisCache对象的 ### 直接使用redis ``` $redis=Cache::redis(); //直接使用$redis操作 //使用完记得释放 Pool::release($redis);//不释放可能会出大问题哦 ``` ###可能遇到的问题 $redis释放后请勿使用,在测试时可能遇不到问题,但是线上环境可能会报错, 你释放了其他协程就有可能获取使用,你继续使用可能会遇到问题 具体解释如下: [https://wiki.swoole.com/#/question/FAQ?id=client-has-already-been-bound-to-another-coroutine](https://wiki.swoole.com/#/question/FAQ?id=client-has-already-been-bound-to-another-coroutine) ``` $redis=Cache::redis(); //直接使用$redis操作 Pool::release($redis); $redis->set(xxxx);