You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Implement CLIENT REPLY ON|OFF|SKIP
This commit is contained in:
12
lib/utils.js
12
lib/utils.js
@@ -90,9 +90,15 @@ function callbackOrEmit (self, callback, err, res) {
|
||||
}
|
||||
}
|
||||
|
||||
function replyInOrder (self, callback, err, res) {
|
||||
// The offline queue has to be checked first, as there might be commands in both queues at the same time
|
||||
var command_obj = self.offline_queue.peekBack() || self.command_queue.peekBack();
|
||||
function replyInOrder (self, callback, err, res, queue) {
|
||||
// If the queue is explicitly passed, use that, otherwise fall back to the offline queue first,
|
||||
// as there might be commands in both queues at the same time
|
||||
var command_obj;
|
||||
if (queue) {
|
||||
command_obj = queue.peekBack();
|
||||
} else {
|
||||
command_obj = self.offline_queue.peekBack() || self.command_queue.peekBack();
|
||||
}
|
||||
if (!command_obj) {
|
||||
process.nextTick(function () {
|
||||
callbackOrEmit(self, callback, err, res);
|
||||
|
Reference in New Issue
Block a user