You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
chore: refactor main code into smaller parts
This commit is contained in:
@@ -6,6 +6,9 @@ const net = require('net')
|
||||
const reconnect = require('./reconnect')
|
||||
const onConnect = require('./readyHandler')
|
||||
const debug = require('./debug')
|
||||
const replyHandler = require('./replyHandler')
|
||||
const onResult = replyHandler.onResult
|
||||
const onError = replyHandler.onError
|
||||
|
||||
/**
|
||||
* @description Create a new Parser instance and pass all the necessary options to it
|
||||
@@ -16,10 +19,10 @@ const debug = require('./debug')
|
||||
function createParser (client) {
|
||||
return new Parser({
|
||||
returnReply (data) {
|
||||
client.returnReply(data)
|
||||
onResult(client, data)
|
||||
},
|
||||
returnError (err) {
|
||||
client.returnError(err)
|
||||
onError(client, err)
|
||||
},
|
||||
returnFatalError (err) {
|
||||
// Error out all fired commands. Otherwise they might rely on faulty data. We have to reconnect to get in a working state again
|
||||
|
Reference in New Issue
Block a user