@nextage/era-lib 1.0.154 → 1.0.156
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.
|
@@ -3,7 +3,7 @@ import { Event, MsgClientInterface, EventSubOptions } from './interfaces';
|
|
|
3
3
|
export declare abstract class Listener<T extends Event> {
|
|
4
4
|
abstract subject: T['subject'];
|
|
5
5
|
abstract queueGroupName: string;
|
|
6
|
-
abstract onMessage(data: T['data'], msg: Message): void
|
|
6
|
+
abstract onMessage(data: T['data'], msg: Message): Promise<void>;
|
|
7
7
|
private readonly client;
|
|
8
8
|
private subscription;
|
|
9
9
|
private messageStack;
|
|
@@ -11,16 +11,16 @@ export declare abstract class Listener<T extends Event> {
|
|
|
11
11
|
protected ackWait: number;
|
|
12
12
|
constructor(client: MsgClientInterface);
|
|
13
13
|
subscriptionOptions(): EventSubOptions;
|
|
14
|
-
listen(): void
|
|
14
|
+
listen(): Promise<void>;
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
|
-
checkMessages(
|
|
19
|
+
checkMessages(): Promise<void>;
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
stop(): void
|
|
23
|
+
stop(): Promise<void>;
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
* @param msg
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-listener.d.ts","sourceRoot":"","sources":["../../src/events/base-listener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAA2C,iBAAiB,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE1E,8BAAsB,QAAQ,CAAC,CAAC,SAAS,KAAK;IAE5C,QAAQ,CAAC,OAAO,EAAS,CAAC,CAAC,SAAS,CAAC,CAAC;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"base-listener.d.ts","sourceRoot":"","sources":["../../src/events/base-listener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAA2C,iBAAiB,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE1E,8BAAsB,QAAQ,CAAC,CAAC,SAAS,KAAK;IAE5C,QAAQ,CAAC,OAAO,EAAS,CAAC,CAAC,SAAS,CAAC,CAAC;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAEhE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,YAAY,CAAmC;IAEvD,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,IAAI,CAA+B;IAE3C,SAAS,CAAC,OAAO,EAAQ,MAAM,CAAe;gBAEjC,MAAM,EAAE,kBAAkB;IAIvC,mBAAmB,IAAI,eAAe;IAKhC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB7B;;;OAGG;IACG,aAAa;IAkBnB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAKrB"}
|
|
@@ -12,8 +12,8 @@ class Listener {
|
|
|
12
12
|
subscriptionOptions() {
|
|
13
13
|
return {};
|
|
14
14
|
}
|
|
15
|
-
listen() {
|
|
16
|
-
this.subscription = this.client.subscribe(this.subject, this.queueGroupName, this.subscriptionOptions());
|
|
15
|
+
async listen() {
|
|
16
|
+
this.subscription = await this.client.subscribe(this.subject, this.queueGroupName, this.subscriptionOptions());
|
|
17
17
|
this.subscription?.on('message', (msg) => {
|
|
18
18
|
nx_frame_be_1.APP.logger.info(`📥 Received message on: ${this.subject} / ${this.queueGroupName}`, (0, nx_frame_be_1.logClassCtx)(this));
|
|
19
19
|
this.messageStack.push(msg);
|
|
@@ -26,10 +26,10 @@ class Listener {
|
|
|
26
26
|
*
|
|
27
27
|
* @returns
|
|
28
28
|
*/
|
|
29
|
-
async checkMessages(
|
|
29
|
+
async checkMessages() {
|
|
30
30
|
if (this.wait || !this.messageStack.length)
|
|
31
31
|
return;
|
|
32
|
-
msg = this.messageStack.shift();
|
|
32
|
+
const msg = this.messageStack.shift();
|
|
33
33
|
if (!msg)
|
|
34
34
|
return;
|
|
35
35
|
this.wait = true;
|
|
@@ -41,7 +41,7 @@ class Listener {
|
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
|
-
stop() {
|
|
44
|
+
async stop() {
|
|
45
45
|
if (this.subscription)
|
|
46
46
|
this.client.unsubscribe(this.subscription);
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-listener.js","sourceRoot":"","sources":["../../src/events/base-listener.ts"],"names":[],"mappings":";;;AAAA,sDAAoF;AAKpF,MAAsB,QAAQ;IAe5B,YAAa,MAA0B;QAL/B,iBAAY,GAAiB,EAAE,CAAC;QAChC,SAAI,GAAyB,KAAK,CAAC;QAEjC,YAAO,GAAoB,CAAC,GAAG,IAAI,CAAC;QAG5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,mBAAmB;QAEjB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM;
|
|
1
|
+
{"version":3,"file":"base-listener.js","sourceRoot":"","sources":["../../src/events/base-listener.ts"],"names":[],"mappings":";;;AAAA,sDAAoF;AAKpF,MAAsB,QAAQ;IAe5B,YAAa,MAA0B;QAL/B,iBAAY,GAAiB,EAAE,CAAC;Q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,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI;QAER,IAAI,IAAI,CAAC,YAAY;YACnB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACK,YAAY,CAAC,GAAY;QAE/B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACzF,CAAC;CACF;AApFD,4BAoFC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextage/era-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.156",
|
|
4
4
|
"main": "./build/index.js",
|
|
5
5
|
"types": "./build/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@apollo/federation-internals": "^2.11.2",
|
|
20
20
|
"@apollo/subgraph": "^2.11.2",
|
|
21
|
-
"@nextage/nx-frame-be": "^1.0.
|
|
21
|
+
"@nextage/nx-frame-be": "^1.0.31",
|
|
22
22
|
"@types/cookie-parser": "^1.4.7",
|
|
23
23
|
"@types/csurf": "^1.11.5",
|
|
24
24
|
"@types/express": "^4.17.21",
|