// Pick a resource from pool manually
$key = $this->redisPool->getKey($originKey);
/** @var \Redis $redis */
$redis = $this->redisPool->pick();
try {
$redis->set('foo', 'bar');
} catch (\Exception $e) {
throw $e;
} finally {
$this->redisPool->release($redis);
}
// Use php stream
unlink('redis://foo'); // del foo
file_put_contents('redis://foo', 'bar'); // set foo bar
file_get_contents('redis://foo') // get foo