Created
May 13, 2013 11:04
-
-
Save toin0u/5567583 to your computer and use it in GitHub Desktop.
When PhpRedis is set up with an Redis::OPT_PREFIX, It does set the prefix to the key and to the timeout value. To set the resolved key in an array seems fixing this issue. @see: https://github.com/nicolasff/phpredis/issues/158
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1', 6379); | |
$redis->setOption(Redis::OPT_PREFIX, 'foo:'); | |
$redis->sAdd('queues', 'my-queue'); | |
// output: "SADD" "foo:queues" "my-queue" | |
$redis->blpop('queue:my-queue', 5); | |
// output: "BLPOP" "foo:queue:my-queue" "foo:5" | |
$redis->blpop(array('queue:my-queue'), 5); | |
// output: "BLPOP" "foo:queue:my-queue" "5" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment