diff --git a/changelog.md b/changelog.md index 780df3be25..d9e1fa8b34 100644 --- a/changelog.md +++ b/changelog.md @@ -37,6 +37,8 @@ Breaking Changes - Removed `authPass` (auth_pass) option. Please use `password` instead - Removed `Redis.print` helper function - Removed backpressure indicator from function return value +- Removed the `stream` parameter from the RedisClient constructor. + Please set the stream in the options instead - Changed return value of `(p)(un)subscribe` - Return an array with the number of current subscribed channels and an array with all affected channels diff --git a/index.js b/index.js index 4259593dc9..d966e97b7e 100644 --- a/index.js +++ b/index.js @@ -27,11 +27,10 @@ class RedisClient extends EventEmitter { /** * Creates an instance of RedisClient. * @param {object} options - * @param {any} [stream] * * @memberof RedisClient */ - constructor (options, stream) { + constructor (options) { super() // Copy the options so they are not mutated options = utils.clone(options) @@ -46,10 +45,9 @@ class RedisClient extends EventEmitter { } } } - if (stream) { + if (options.stream) { // The stream from the outside is used so no connection from this side is triggered but from the server this client should talk to // Reconnect etc won't work with this. This requires monkey patching to work, so it is not officially supported - options.stream = stream this.address = '"Private stream"' } else if (options.path) { cnxOptions.path = options.path