I do it like this:
$r = new Predis\Client($single_server, $options);
$retval = $r->blpop('queue:query');
But I get this error:
ERR wrong number of arguments for 'blpop' command
Whenever I do this
$r = new Predis\Client($single_server, $options);
$retval = $r->blpop('queue:query',0);
I get the error:
Error while reading line from the server
Doing it from redis-cli
redis 127.0.0.1:6379> BLPOP queue:query
(error) ERR wrong number of arguments for 'blpop' command
redis 127.0.0.1:6379> BLPOP queue:query 0
1) "queue:query"
2) "hello world"
Seems like a bug. The latest version doesn’t have this issue, also it apparently dropped namespaces:
It blocked when I accessed the page. Then, I issued
LPUSH queue:query 0, went back to the page, and got this:Nevertheless, I would recommend the use of phpredis, it is faster than this library, because it is compiled as a php extension. If you have the rights in your server, that’s a good pick.