You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
feat: add auto pipeline
This commit is contained in:
@@ -6,6 +6,9 @@ const Command = require('./command')
|
||||
function onConnect (client) {
|
||||
debug('Stream connected %s id %s', client.address, client.connectionId)
|
||||
|
||||
// TODO: Check if the clients prototype and the clients instance have
|
||||
// fast properties. If that's not the case, make them fast properties
|
||||
// again!
|
||||
client.connected = true
|
||||
client.ready = false
|
||||
client.emittedEnd = false
|
||||
@@ -49,22 +52,6 @@ function readyHandler (client) {
|
||||
debug('readyHandler called %s id %s', client.address, client.connectionId)
|
||||
client.ready = true
|
||||
|
||||
client.cork = () => {
|
||||
client.pipeline = true
|
||||
client._stream.cork()
|
||||
}
|
||||
client.uncork = () => {
|
||||
if (client.fireStrings) {
|
||||
client.writeStrings()
|
||||
} else {
|
||||
client.writeBuffers()
|
||||
}
|
||||
client.pipeline = false
|
||||
client.fireStrings = true
|
||||
// TODO: Consider using next tick here. See https://github.com/NodeRedis/nodeRedis/issues/1033
|
||||
client._stream.uncork()
|
||||
}
|
||||
|
||||
if (client.selectedDb !== undefined) {
|
||||
client.internalSendCommand(new Command('select', [client.selectedDb])).catch((err) => {
|
||||
if (!client.closing) {
|
||||
|
Reference in New Issue
Block a user