ioredis 5.3.0 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/built/Redis.d.ts +14 -0
- package/built/autoPipelining.js +1 -0
- package/built/redis/event_handler.js +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
A robust, performance-focused and full-featured [Redis](http://redis.io) client for [Node.js](https://nodejs.org).
|
|
10
10
|
|
|
11
|
-
Supports Redis >= 2.6.12 and
|
|
11
|
+
Supports Redis >= 2.6.12 and the latest version of [Dragonfly](https://dragonflydb.io/). Completely compatible with Redis 7.x.
|
|
12
12
|
|
|
13
13
|
# Features
|
|
14
14
|
|
|
@@ -884,6 +884,15 @@ Alternatively, specify the connection through a [`rediss://` URL](https://www.ia
|
|
|
884
884
|
const redis = new Redis("rediss://redis.my-service.com");
|
|
885
885
|
```
|
|
886
886
|
|
|
887
|
+
If you do not want to use a connection string, you can also specify an empty `tls: {}` object:
|
|
888
|
+
|
|
889
|
+
```javascript
|
|
890
|
+
const redis = new Redis({
|
|
891
|
+
host: 'redis.my-service.com',
|
|
892
|
+
tls: {}
|
|
893
|
+
});
|
|
894
|
+
```
|
|
895
|
+
|
|
887
896
|
### TLS Profiles
|
|
888
897
|
|
|
889
898
|
> **Warning**
|
package/built/Redis.d.ts
CHANGED
|
@@ -207,6 +207,20 @@ declare class Redis extends Commander implements DataHandledable {
|
|
|
207
207
|
private _readyCheck;
|
|
208
208
|
}
|
|
209
209
|
interface Redis extends EventEmitter {
|
|
210
|
+
on(event: "message", cb: (channel: string, message: string) => void): this;
|
|
211
|
+
once(event: "message", cb: (channel: string, message: string) => void): this;
|
|
212
|
+
on(event: "messageBuffer", cb: (channel: Buffer, message: Buffer) => void): this;
|
|
213
|
+
once(event: "messageBuffer", cb: (channel: Buffer, message: Buffer) => void): this;
|
|
214
|
+
on(event: "pmessage", cb: (pattern: string, channel: string, message: string) => void): this;
|
|
215
|
+
once(event: "pmessage", cb: (pattern: string, channel: string, message: string) => void): this;
|
|
216
|
+
on(event: "pmessageBuffer", cb: (pattern: string, channel: Buffer, message: Buffer) => void): this;
|
|
217
|
+
once(event: "pmessageBuffer", cb: (pattern: string, channel: Buffer, message: Buffer) => void): this;
|
|
218
|
+
on(event: "error", cb: (error: Error) => void): this;
|
|
219
|
+
once(event: "error", cb: (error: Error) => void): this;
|
|
220
|
+
on(event: RedisStatus, cb: () => void): this;
|
|
221
|
+
once(event: RedisStatus, cb: () => void): this;
|
|
222
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
223
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
210
224
|
}
|
|
211
225
|
interface Redis extends Transaction {
|
|
212
226
|
}
|
package/built/autoPipelining.js
CHANGED
|
@@ -134,17 +134,22 @@ function abortTransactionFragments(commandQueue) {
|
|
|
134
134
|
}
|
|
135
135
|
function closeHandler(self) {
|
|
136
136
|
return function () {
|
|
137
|
+
const prevStatus = self.status;
|
|
137
138
|
self.setStatus("close");
|
|
138
|
-
if (!self.prevCondition) {
|
|
139
|
-
self.prevCondition = self.condition;
|
|
140
|
-
}
|
|
141
139
|
if (self.commandQueue.length) {
|
|
142
140
|
abortIncompletePipelines(self.commandQueue);
|
|
143
|
-
self.prevCommandQueue = self.commandQueue;
|
|
144
141
|
}
|
|
145
142
|
if (self.offlineQueue.length) {
|
|
146
143
|
abortTransactionFragments(self.offlineQueue);
|
|
147
144
|
}
|
|
145
|
+
if (prevStatus === "ready") {
|
|
146
|
+
if (!self.prevCondition) {
|
|
147
|
+
self.prevCondition = self.condition;
|
|
148
|
+
}
|
|
149
|
+
if (self.commandQueue.length) {
|
|
150
|
+
self.prevCommandQueue = self.commandQueue;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
148
153
|
if (self.manuallyClosing) {
|
|
149
154
|
self.manuallyClosing = false;
|
|
150
155
|
debug("skip reconnecting since the connection is manually closed.");
|