Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/redis_commands.c b/redis_commands.c
index 2ad7e212..3c127b82 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -1251,6 +1251,15 @@ static int gen_varkey_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
return SUCCESS;
}
+/* Generic handling of every blocking pop command (BLPOP, BZPOP[MIN/MAX], etc */
+int redis_blocking_pop_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
+ char *kw, char **cmd, int *cmd_len, short *slot,
+ void **ctx)
+{
+ return gen_varkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, kw,
+ strlen(kw), 2, 2, cmd, cmd_len, slot);
+}
+
/*
* Commands with specific signatures or that need unique functions because they
* have specific processing (argument validation, etc) that make them unique
@@ -3044,22 +3053,6 @@ int redis_watch_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
"WATCH", sizeof("WATCH")-1, 1, 0, cmd, cmd_len, slot);
}
-/* BLPOP */
-int redis_blpop_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
- char **cmd, int *cmd_len, short *slot, void **ctx)
-{
- return gen_varkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock,
- "BLPOP", sizeof("BLPOP")-1, 2, 1, cmd, cmd_len, slot);
-}
-
-/* BRPOP */
-int redis_brpop_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
- char **cmd, int *cmd_len, short *slot, void **ctx)
-{
- return gen_varkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock,
- "BRPOP", sizeof("BRPOP")-1, 1, 1, cmd, cmd_len, slot);
-}
-
/* SINTER */
int redis_sinter_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
char **cmd, int *cmd_len, short *slot, void **ctx)