Added BLPOP and BRPOP.

This commit is contained in:
Daniele Alessandri
2009-12-30 09:35:46 +01:00
parent 55c40afcd8
commit f3aeecef37
+21
View File
@@ -886,6 +886,19 @@ class RedisServer__V1_2 extends RedisServer__V1_0 {
}
}
class RedisServer__Futures extends RedisServer__V1_2 {
public function getVersion() { return 0; }
public function getSupportedCommands() {
return array_merge(parent::getSupportedCommands(), array(
/* commands operating on lists */
'blpop' => '\Predis\Commands\ListPopFirstBlocking',
'popFirstBlocking' => '\Predis\Commands\ListPopFirstBlocking',
'brpop' => '\Predis\Commands\ListPopLastBlocking',
'popLastBlocking' => '\Predis\Commands\ListPopLastBlocking'
));
}
}
/* ------------------------------------------------------------------------- */
namespace Predis\Utilities;
@@ -1137,6 +1150,14 @@ class ListPopLast extends \Predis\InlineCommand {
public function getCommandId() { return 'RPOP'; }
}
class ListPopFirstBlocking extends \Predis\InlineCommand {
public function getCommandId() { return 'BRPOP'; }
}
class ListPopLastBlocking extends \Predis\InlineCommand {
public function getCommandId() { return 'BRPOP'; }
}
/* commands operating on sets */
class SetAdd extends \Predis\BulkCommand {
public function getCommandId() { return 'SADD'; }