@c9up/echo 0.2.0 → 0.2.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/dist/quasar.d.ts.map +1 -1
- package/dist/quasar.js +11 -11
- package/dist/quasar.js.map +1 -1
- package/package.json +12 -11
- package/src/quasar.ts +19 -16
package/dist/quasar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quasar.d.ts","sourceRoot":"","sources":["../src/quasar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAc,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAwBtE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAS1E;
|
|
1
|
+
{"version":3,"file":"quasar.d.ts","sourceRoot":"","sources":["../src/quasar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAc,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAwBtE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAS1E;AAwED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,QAAQ,CA0FX"}
|
package/dist/quasar.js
CHANGED
|
@@ -131,18 +131,18 @@ export function quasarBus(options) {
|
|
|
131
131
|
// quietly incoherent.
|
|
132
132
|
const attempt = (async () => {
|
|
133
133
|
const source = await manager();
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
// Waited on through the callbacks, not on the call's return value:
|
|
135
|
+
// `subscribe` reports a failure rather than rejecting, and newer
|
|
136
|
+
// quasar declares it `void`. This shape is correct against both.
|
|
137
|
+
await new Promise((resolve, reject) => {
|
|
138
|
+
source.subscribe(channel, wrapper, {
|
|
139
|
+
onSubscription: () => resolve(),
|
|
140
|
+
onError: (error) => {
|
|
141
|
+
opened.delete(handler);
|
|
142
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
143
|
+
},
|
|
144
|
+
});
|
|
139
145
|
});
|
|
140
|
-
if (reported !== undefined) {
|
|
141
|
-
opened.delete(handler);
|
|
142
|
-
throw reported instanceof Error
|
|
143
|
-
? reported
|
|
144
|
-
: new Error(String(reported));
|
|
145
|
-
}
|
|
146
146
|
return wrapper;
|
|
147
147
|
})();
|
|
148
148
|
opened.set(handler, attempt);
|
package/dist/quasar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quasar.js","sourceRoot":"","sources":["../src/quasar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAExF;;;;;;;;;GASG;AACH,MAAM,QAAQ,GAAG;IAChB,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,UAAU;IACV,QAAQ;IACR,KAAK;CACI,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC7C,OAAO,KAAK,IAAI,EAAE,CACjB,oBAAoB,CAAc;QACjC,GAAG,EAAE,MAAM;QACX,IAAI;QACJ,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EA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,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;wBACnE,CAAC;qBACD,CAAC,CAAC;gBACJ,CAAC,CAAC,CAAC;gBACH,OAAO,OAAO,CAAC;YAChB,CAAC,CAAC,EAAE,CAAC;YACL,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7B,oEAAoE;YACpE,sDAAsD;YACtD,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5C,MAAM,OAAO,CAAC;QACf,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,OAAsC;YACvD,sEAAsE;YACtE,oEAAoE;YACpE,mCAAmC;YACnC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACpC,IAAI,OAAO,KAAK,SAAS;gBAAE,OAAO;YAClC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC;YAC9B,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,CAAC;YAC/B,qEAAqE;YACrE,mEAAmE;YACnE,yBAAyB;YACzB,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,iEAAiE;YACjE,iEAAiE;YACjE,kCAAkC;YAClC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c9up/echo",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Cache — pluggable cache contract with memory + Redis drivers for the Ream framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,20 +29,21 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@c9up/
|
|
33
|
-
"@c9up/
|
|
32
|
+
"@c9up/quasar": "^0.1.0 || ^0.2.0",
|
|
33
|
+
"@c9up/ream": "^0.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@biomejs/biome": "^2.
|
|
37
|
-
"@c9up/quasar": "^0.1.0",
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
36
|
+
"@biomejs/biome": "^2.5.12",
|
|
37
|
+
"@c9up/quasar": "^0.1.0 || ^0.2.0",
|
|
38
|
+
"@c9up/ream": "^0.2.0",
|
|
39
|
+
"@types/node": "^22.20.1",
|
|
40
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
41
|
+
"typescript": "^6.0.3",
|
|
42
|
+
"vitest": "4.1.11"
|
|
43
43
|
},
|
|
44
|
+
"//engines": "Node 24, not 22, because AsyncLocalStorage sits on the request hot path — the container resolves through it, HttpContext is it, and the emitter reads it on every event. Node 24 backs it with AsyncContextFrame by default, and measured on that exact pattern (one context per request, six async boundaries, several reads) it costs 0.61 us per request instead of 1.55 us: 2.5x, on every request, for free. Before 24 the same mechanism existed only behind an experimental flag, and a framework cannot base its performance on a flag the application has to remember to pass. This is NOT 'track the current LTS' — security fixes still land in 22 until 2027, npm 11 is irrelevant under pnpm, and node:sqlite is not what atlas uses.",
|
|
44
45
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
46
|
+
"node": ">=24.0.0"
|
|
46
47
|
},
|
|
47
48
|
"files": [
|
|
48
49
|
"src",
|
package/src/quasar.ts
CHANGED
|
@@ -72,12 +72,15 @@ interface PubSubSource {
|
|
|
72
72
|
channel: string,
|
|
73
73
|
handler: (message: string) => void,
|
|
74
74
|
/**
|
|
75
|
-
* How
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
75
|
+
* How the outcome is REPORTED. Quasar catches the Redis error and calls
|
|
76
|
+
* `onError` rather than rejecting, and newer versions declare
|
|
77
|
+
* `subscribe` itself `void` — so the call's return value proves nothing
|
|
78
|
+
* either way, and these two are the whole signal.
|
|
79
79
|
*/
|
|
80
|
-
options?: {
|
|
80
|
+
options?: {
|
|
81
|
+
onSubscription?: (count: number) => void;
|
|
82
|
+
onError?: (error: unknown) => void;
|
|
83
|
+
},
|
|
81
84
|
): unknown;
|
|
82
85
|
/**
|
|
83
86
|
* Optional, and NAMED when it is there: quasar stacks handlers per channel,
|
|
@@ -185,18 +188,18 @@ export function quasarBus(options?: {
|
|
|
185
188
|
// quietly incoherent.
|
|
186
189
|
const attempt = (async (): Promise<(raw: string) => void> => {
|
|
187
190
|
const source = await manager();
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
// Waited on through the callbacks, not on the call's return value:
|
|
192
|
+
// `subscribe` reports a failure rather than rejecting, and newer
|
|
193
|
+
// quasar declares it `void`. This shape is correct against both.
|
|
194
|
+
await new Promise<void>((resolve, reject) => {
|
|
195
|
+
source.subscribe(channel, wrapper, {
|
|
196
|
+
onSubscription: () => resolve(),
|
|
197
|
+
onError: (error) => {
|
|
198
|
+
opened.delete(handler);
|
|
199
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
200
|
+
},
|
|
201
|
+
});
|
|
193
202
|
});
|
|
194
|
-
if (reported !== undefined) {
|
|
195
|
-
opened.delete(handler);
|
|
196
|
-
throw reported instanceof Error
|
|
197
|
-
? reported
|
|
198
|
-
: new Error(String(reported));
|
|
199
|
-
}
|
|
200
203
|
return wrapper;
|
|
201
204
|
})();
|
|
202
205
|
opened.set(handler, attempt);
|