@hexok/queue-redis 1.1.1 → 1.1.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 +1 -1
- package/dist/codec.d.ts +1 -0
- package/dist/codec.d.ts.map +1 -1
- package/dist/codec.js +7 -1
- package/dist/codec.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ Every log carries `adapter: 'queue'`. `connection` is `commands` or `blocking`,
|
|
|
142
142
|
| `retentionMs` | `86400000` | Entries older than this are trimmed with `XTRIM MINID`, after each publish and every minute, on the topics this instance published to. One day by default. `maintain()` does not use it. |
|
|
143
143
|
| `trim` | `'published'` | `'published'` age-trims only topics this instance published to. `false` never age-trims, and `MAXLEN ~` on `XADD` still applies. |
|
|
144
144
|
| `encode` | `JSON.stringify` | Turns a payload into the `payload` field. |
|
|
145
|
-
| `decode` | `JSON.parse` | Turns the `payload` field back. A failure parks the entry and acks it. |
|
|
145
|
+
| `decode` | `JSON.parse` | Turns the `payload` field back. A bad entry throws `queue: entry is not JSON` and does not include the text. A failure parks the entry and acks it. |
|
|
146
146
|
| `logger` | no-op | A structural `LogSink`. `@hexok/logger` and `console` fit it. |
|
|
147
147
|
| `quarantine` | unset | A structural `ParkSink`, such as `@hexok/quarantine`. It receives what the queue cannot publish or deliver. |
|
|
148
148
|
|
package/dist/codec.d.ts
CHANGED
package/dist/codec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAM/C"}
|
package/dist/codec.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export function encodeJson(payload) {
|
|
2
2
|
return JSON.stringify(payload);
|
|
3
3
|
}
|
|
4
|
+
/** `JSON.parse`. The error does not include the text. Node quotes the start of it. */
|
|
4
5
|
export function decodeJson(raw) {
|
|
5
|
-
|
|
6
|
+
try {
|
|
7
|
+
return JSON.parse(raw);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
throw new Error('queue: entry is not JSON');
|
|
11
|
+
}
|
|
6
12
|
}
|
|
7
13
|
//# sourceMappingURL=codec.js.map
|
package/dist/codec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|