官网上的示例是
$client = new swoole_redis;
$client->connect('127.0.0.1', 6379, function (swoole_redis $client, $result) {
if ($result === false) {
echo "connect to redis server failed.\n";
return;
}
$client->set('key', 'swoole', function (swoole_redis $client, $result) {
var_dump($result);
});
});
也没看到怎么设置过期时间啊