summaryrefslogtreecommitdiff
path: root/src/blocked.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-12-04 15:52:20 +0100
committerantirez <antirez@gmail.com>2013-12-04 16:20:03 +0100
commitc5618e7fdd1db874b785c19f53f01e78ea56007a (patch)
tree9db2421577c0448162420dea76555de29f1fa628 /src/blocked.c
parentc2f305545aa9b2c9f68bc537363c73f8b831e055 (diff)
downloadredis-c5618e7fdd1db874b785c19f53f01e78ea56007a.tar.gz
WAIT command: synchronous replication for Redis.
Diffstat (limited to 'src/blocked.c')
-rw-r--r--src/blocked.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 667b75a62..4cd632bd3 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -130,6 +130,8 @@ void processUnblockedClients(void) {
void unblockClient(redisClient *c) {
if (c->btype == REDIS_BLOCKED_LIST) {
unblockClientWaitingData(c);
+ } else if (c->btype == REDIS_BLOCKED_WAIT) {
+ unblockClientWaitingReplicas(c);
} else {
redisPanic("Unknown btype in unblockClient().");
}
@@ -147,6 +149,8 @@ void unblockClient(redisClient *c) {
void replyToBlockedClientTimedOut(redisClient *c) {
if (c->btype == REDIS_BLOCKED_LIST) {
addReply(c,shared.nullmultibulk);
+ } else if (c->btype == REDIS_BLOCKED_WAIT) {
+ addReplyLongLong(c,replicationCountAcksByOffset(c->bpop.reploffset));
} else {
redisPanic("Unknown btype in replyToBlockedClientTimedOut().");
}