- addReplyMultiBulkLen(receiver,2);
- addReplyBulk(receiver,key);
- addReplyBulk(receiver,ele);
+ if (receiver->blocking_target == NULL) {
+ addReplyMultiBulkLen(receiver,2);
+ addReplyBulk(receiver,key);
+ addReplyBulk(receiver,ele);
+ }
+ else {
+ receiver->argc++;
+
+ robj *dobj = lookupKeyWrite(receiver->db,receiver->blocking_target);
+ if (dobj && checkType(receiver,dobj,REDIS_LIST)) return 0;
+
+ addReplyBulk(receiver,ele);
+
+ /* Create the list if the key does not exist */
+ if (!dobj) {
+ dobj = createZiplistObject();
+ dbAdd(receiver->db,receiver->blocking_target,dobj);
+ }
+
+ listTypePush(dobj,ele,REDIS_HEAD);
+ }
+