🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# Coroutine\\Redis::\_\_construct [TOC] 方法的使用基本与[phpredis](https://github.com/phpredis/phpredis)保持一致。 #### 不同于[phpredis](https://github.com/phpredis/phpredis)的实现 * * * 1、尚未实现的Redis命令:`scan object sort migrate hscan sscan zscan` 2、`subscribe pSubscribe`的使用方式,无需设置回调函数: Redis协程客户端构造方法,可以设置`Redis`连接的配置选项。 ~~~ function swoole_redis->__construct(array $options = null); ~~~ ## 超时控制 > connect\_timout 在 4.2.10 中加入, 细分为连接超时和读写超时 ~~~ $options = [ 'connect_timeout' => 1, 'timeout' => 5 ]; ~~~ * 浮点型,单位为秒,最小粒度为`1毫秒` 3、序列化PHP变量的支持,在connect方法的第三个参数设置为true时,开启序列化php变量特性,默认为false