@rxdi/nats 0.7.249 → 0.7.251
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/services/nats-client.service.js +26 -7
- package/dist/services/nats-client.service.js.map +1 -1
- package/dist/services/nats-pubsub.class.d.ts +7 -19
- package/dist/services/nats-pubsub.class.js +7 -45
- package/dist/services/nats-pubsub.class.js.map +1 -1
- package/dist/services/pubsub-async-iterator.d.ts +33 -13
- package/dist/services/pubsub-async-iterator.js +77 -26
- package/dist/services/pubsub-async-iterator.js.map +1 -1
- package/package.json +2 -2
|
@@ -39,6 +39,23 @@ exports.NatsHandlerError = NatsHandlerError;
|
|
|
39
39
|
* carry an `error` field of its own.
|
|
40
40
|
*/
|
|
41
41
|
const NATS_ERROR_TAG = '__natsError';
|
|
42
|
+
/**
|
|
43
|
+
* Decode a NATS message payload to a UTF-8 string.
|
|
44
|
+
*
|
|
45
|
+
* `@nats-io/nats-core` delivers `msg.data` as a `Uint8Array`. Depending on how
|
|
46
|
+
* the core reassembles the frame off the socket, that value is sometimes a Node
|
|
47
|
+
* `Buffer` (single read) and sometimes a plain `Uint8Array` (payload spanning
|
|
48
|
+
* multiple reads — common for larger messages). `Buffer.prototype.toString()`
|
|
49
|
+
* decodes UTF-8, but `Uint8Array.prototype.toString()` returns comma-separated
|
|
50
|
+
* byte values (e.g. "123,34,..."), so calling `.toString()` on the raw payload
|
|
51
|
+
* silently corrupts every large message ~a third of the time, making
|
|
52
|
+
* `JSON.parse` throw non-deterministically. `TextDecoder` decodes both
|
|
53
|
+
* correctly, so always route payloads through it.
|
|
54
|
+
*/
|
|
55
|
+
const textDecoder = new TextDecoder();
|
|
56
|
+
function decodePayload(data) {
|
|
57
|
+
return (data === null || data === void 0 ? void 0 : data.length) ? textDecoder.decode(data) : '';
|
|
58
|
+
}
|
|
42
59
|
function isErrorEnvelope(v) {
|
|
43
60
|
return (!!v &&
|
|
44
61
|
typeof v === 'object' &&
|
|
@@ -118,7 +135,8 @@ let NatsClientService = class NatsClientService {
|
|
|
118
135
|
try {
|
|
119
136
|
for await (const msg of sub) {
|
|
120
137
|
try {
|
|
121
|
-
const
|
|
138
|
+
const text = decodePayload(msg.data);
|
|
139
|
+
const data = text ? JSON.parse(text) : null;
|
|
122
140
|
const result = await handler(data);
|
|
123
141
|
if (msg.reply) {
|
|
124
142
|
(_a = this.client) === null || _a === void 0 ? void 0 : _a.publish(msg.reply, JSON.stringify(result));
|
|
@@ -150,12 +168,12 @@ let NatsClientService = class NatsClientService {
|
|
|
150
168
|
(async () => {
|
|
151
169
|
try {
|
|
152
170
|
for await (const msg of sub) {
|
|
171
|
+
const text = decodePayload(msg.data);
|
|
153
172
|
try {
|
|
154
|
-
|
|
155
|
-
callback(data);
|
|
173
|
+
callback(text ? JSON.parse(text) : null);
|
|
156
174
|
}
|
|
157
175
|
catch (_a) {
|
|
158
|
-
callback(
|
|
176
|
+
callback(text);
|
|
159
177
|
}
|
|
160
178
|
}
|
|
161
179
|
}
|
|
@@ -180,13 +198,14 @@ let NatsClientService = class NatsClientService {
|
|
|
180
198
|
this.logger.debug(`[NatsClientService] Sending request to ${channel}:`, data);
|
|
181
199
|
const message = typeof data === 'string' ? data : JSON.stringify(data);
|
|
182
200
|
const response = await this.client.request(channel, message, { timeout });
|
|
183
|
-
|
|
201
|
+
const text = decodePayload(response.data);
|
|
202
|
+
if (text) {
|
|
184
203
|
let result;
|
|
185
204
|
try {
|
|
186
|
-
result = JSON.parse(
|
|
205
|
+
result = JSON.parse(text);
|
|
187
206
|
}
|
|
188
207
|
catch (_a) {
|
|
189
|
-
return
|
|
208
|
+
return text;
|
|
190
209
|
}
|
|
191
210
|
// Remote handler threw — surface as a real exception instead of
|
|
192
211
|
// letting a garbage payload silently flow back to the caller.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nats-client.service.js","sourceRoot":"","sources":["../../src/services/nats-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qCAAwD;AACxD,4DAAyE;AAIzE,8CAAyF;AACzF,+DAA0D;AAI1D;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IAGzC,YAAY,OAAe,EAAE,WAAmB;QAC9C,KAAK,CAAC,0BAA0B,OAAO,KAAK,WAAW,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF;AATD,4CASC;AAED;;;;;GAKG;AACH,MAAM,cAAc,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"nats-client.service.js","sourceRoot":"","sources":["../../src/services/nats-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qCAAwD;AACxD,4DAAyE;AAIzE,8CAAyF;AACzF,+DAA0D;AAI1D;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IAGzC,YAAY,OAAe,EAAE,WAAmB;QAC9C,KAAK,CAAC,0BAA0B,OAAO,KAAK,WAAW,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF;AATD,4CASC;AAED;;;;;GAKG;AACH,MAAM,cAAc,GAAG,aAAa,CAAC;AAErC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AACtC,SAAS,aAAa,CAAC,IAAmC;IACxD,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,SAAS,eAAe,CAAC,CAAU;IACjC,OA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CAAC,MAAM,CAAC;IAC3C,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF,CAAA;AA7LY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,iBAAU,GAAE;IAUR,WAAA,IAAA,aAAM,EAAC,+BAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,aAAM,EAAC,wBAAW,CAAC,CAAA;6CAAiB,uCAAiB;GAV7C,iBAAiB,CA6L7B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NatsClientInterface, NatsPubSubInterface } from '../interfaces';
|
|
2
|
+
import { PubSubAsyncIterator } from './pubsub-async-iterator';
|
|
2
3
|
export declare class NatsPubSub implements NatsPubSubInterface {
|
|
3
4
|
private subscriptionMap;
|
|
4
5
|
private subsRefsMap;
|
|
@@ -13,24 +14,11 @@ export declare class NatsPubSub implements NatsPubSubInterface {
|
|
|
13
14
|
asyncIterator<T>(triggers: string | string[]): AsyncIterator<T>;
|
|
14
15
|
asyncIterableIterator<T>(triggers: string | string[]): AsyncIterator<T>;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
private rejectPromise;
|
|
23
|
-
private returnPromise;
|
|
24
|
-
constructor(pubsub: NatsPubSubInterface, triggers: string | string[]);
|
|
25
|
-
next(): Promise<{
|
|
26
|
-
value: T;
|
|
27
|
-
done: boolean;
|
|
28
|
-
}>;
|
|
29
|
-
return(): Promise<{
|
|
30
|
-
value: T;
|
|
31
|
-
done: boolean;
|
|
32
|
-
}>;
|
|
33
|
-
throw?(error?: any): Promise<never>;
|
|
34
|
-
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
17
|
+
/**
|
|
18
|
+
* Kept as a distinct exported name for backwards compatibility; the buffered,
|
|
19
|
+
* loss-free implementation lives in PubSubAsyncIterator (see its doc comment
|
|
20
|
+
* for the same-tick message-drop bug this fixes).
|
|
21
|
+
*/
|
|
22
|
+
export declare class NatsPubSubAsyncIterator<T> extends PubSubAsyncIterator<T> {
|
|
35
23
|
}
|
|
36
24
|
export declare function createNatsPubSub(natsClient: NatsClientInterface): NatsPubSub;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NatsPubSubAsyncIterator = exports.NatsPubSub = void 0;
|
|
4
4
|
exports.createNatsPubSub = createNatsPubSub;
|
|
5
|
+
const pubsub_async_iterator_1 = require("./pubsub-async-iterator");
|
|
5
6
|
class NatsPubSub {
|
|
6
7
|
constructor(natsClient) {
|
|
7
8
|
this.subscriptionMap = new Map();
|
|
@@ -69,51 +70,12 @@ class NatsPubSub {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
exports.NatsPubSub = NatsPubSub;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this.returnPromise = new Promise((resolve, reject) => {
|
|
79
|
-
this.resolveReturn = resolve;
|
|
80
|
-
this.rejectPromise = reject;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
async next() {
|
|
84
|
-
if (!this.subscriptionId) {
|
|
85
|
-
const trigger = Array.isArray(this.triggers) ? this.triggers[0] : this.triggers;
|
|
86
|
-
this.subscriptionId = await this.pubsub.subscribe(trigger, async (message) => {
|
|
87
|
-
for (const listener of this.listeners) {
|
|
88
|
-
listener(message);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
return new Promise((resolve) => {
|
|
93
|
-
const listener = (value) => {
|
|
94
|
-
this.listeners = this.listeners.filter((l) => l !== listener);
|
|
95
|
-
resolve({ value, done: false });
|
|
96
|
-
};
|
|
97
|
-
this.listeners.push(listener);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
async return() {
|
|
101
|
-
if (this.subscriptionId) {
|
|
102
|
-
await this.pubsub.unsubscribe(this.subscriptionId);
|
|
103
|
-
this.subscriptionId = null;
|
|
104
|
-
}
|
|
105
|
-
return { value: undefined, done: true };
|
|
106
|
-
}
|
|
107
|
-
async throw(error) {
|
|
108
|
-
if (this.subscriptionId) {
|
|
109
|
-
await this.pubsub.unsubscribe(this.subscriptionId);
|
|
110
|
-
this.subscriptionId = null;
|
|
111
|
-
}
|
|
112
|
-
return Promise.reject(error);
|
|
113
|
-
}
|
|
114
|
-
[Symbol.asyncIterator]() {
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
73
|
+
/**
|
|
74
|
+
* Kept as a distinct exported name for backwards compatibility; the buffered,
|
|
75
|
+
* loss-free implementation lives in PubSubAsyncIterator (see its doc comment
|
|
76
|
+
* for the same-tick message-drop bug this fixes).
|
|
77
|
+
*/
|
|
78
|
+
class NatsPubSubAsyncIterator extends pubsub_async_iterator_1.PubSubAsyncIterator {
|
|
117
79
|
}
|
|
118
80
|
exports.NatsPubSubAsyncIterator = NatsPubSubAsyncIterator;
|
|
119
81
|
function createNatsPubSub(natsClient) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nats-pubsub.class.js","sourceRoot":"","sources":["../../src/services/nats-pubsub.class.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"nats-pubsub.class.js","sourceRoot":"","sources":["../../src/services/nats-pubsub.class.ts"],"names":[],"mappings":";;;AAiGA,4CAEC;AAlGD,mEAA8D;AAE9D,MAAa,UAAU;IAQrB,YAAY,UAA+B;QAPnC,oBAAe,GAAG,IAAI,GAAG,EAA+C,CAAC;QACzE,gBAAW,GAAG,IAAI,GAAG,EAAoB,CAAC;QAC1C,0BAAqB,GAAG,CAAC,CAAC;QAC1B,mBAAc,GAAG,IAAI,GAAG,EAAsB,CAAC;QAC/C,oBAAe,GAAwB,IAAI,GAAG,EAAE,CAAC;QAIvD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,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AA2B;QAC1C,OAAO,IAAI,uBAAuB,CAAI,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;IAED,qBAAqB,CAAI,QAA2B;QAClD,OAAO,IAAI,uBAAuB,CAAI,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AArFD,gCAqFC;AAED;;;;GAIG;AACH,MAAa,uBAA2B,SAAQ,2CAAsB;CAAG;AAAzE,0DAAyE;AAEzE,SAAgB,gBAAgB,CAAC,UAA+B;IAC9D,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -1,21 +1,41 @@
|
|
|
1
1
|
import { NatsPubSubInterface } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Async iterator over a NATS subject with an internal message buffer.
|
|
4
|
+
*
|
|
5
|
+
* The buffer is what makes delivery loss-free: the GraphQL execution layer
|
|
6
|
+
* pulls with `next()` one result at a time, and between resolving result N
|
|
7
|
+
* and requesting result N+1 there is always at least one microtask gap. Two
|
|
8
|
+
* messages published back-to-back (e.g. two CASHED_OUT events settled in the
|
|
9
|
+
* same engine tick) used to race that gap — the second message arrived while
|
|
10
|
+
* no `next()` was pending and was silently discarded. Now every incoming
|
|
11
|
+
* message either resolves a pending pull immediately or is queued in arrival
|
|
12
|
+
* order until the next pull (the standard push/pull-queue pattern from
|
|
13
|
+
* graphql-subscriptions' PubSubAsyncIterator).
|
|
14
|
+
*
|
|
15
|
+
* Also fixed relative to the previous implementation:
|
|
16
|
+
* - a subscription id of 0 (the first id NatsPubSub hands out) was treated
|
|
17
|
+
* as "not subscribed", causing a duplicate subscription on every `next()`;
|
|
18
|
+
* the subscription is now tracked by promise, not by truthiness of the id.
|
|
19
|
+
* - two concurrent first `next()` calls could each open a subscription; the
|
|
20
|
+
* shared promise makes the subscription happen exactly once.
|
|
21
|
+
* - `return()` now drains pending pulls with `done: true` so the GraphQL
|
|
22
|
+
* layer's cleanup never hangs on an unresolved `next()`.
|
|
23
|
+
*/
|
|
2
24
|
export declare class PubSubAsyncIterator<T> implements AsyncIterator<T> {
|
|
3
25
|
private pubsub;
|
|
4
26
|
private triggers;
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
private rejectPromise;
|
|
27
|
+
private pullQueue;
|
|
28
|
+
private pushQueue;
|
|
29
|
+
private running;
|
|
30
|
+
private subscriptionPromise;
|
|
10
31
|
constructor(pubsub: NatsPubSubInterface, triggers: string | string[]);
|
|
11
|
-
next(): Promise<
|
|
12
|
-
|
|
13
|
-
done: boolean;
|
|
14
|
-
}>;
|
|
15
|
-
return(): Promise<{
|
|
16
|
-
value: T;
|
|
17
|
-
done: boolean;
|
|
18
|
-
}>;
|
|
32
|
+
next(): Promise<IteratorResult<T>>;
|
|
33
|
+
return(): Promise<IteratorResult<T>>;
|
|
19
34
|
throw?(error?: any): Promise<never>;
|
|
20
35
|
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
36
|
+
/** Subscribe exactly once, no matter how many `next()` calls race here. */
|
|
37
|
+
private subscribeOnce;
|
|
38
|
+
/** Hand the message to a pending pull, or buffer it in arrival order. */
|
|
39
|
+
private pushValue;
|
|
40
|
+
private shutdown;
|
|
21
41
|
}
|
|
@@ -1,51 +1,102 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PubSubAsyncIterator = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Async iterator over a NATS subject with an internal message buffer.
|
|
6
|
+
*
|
|
7
|
+
* The buffer is what makes delivery loss-free: the GraphQL execution layer
|
|
8
|
+
* pulls with `next()` one result at a time, and between resolving result N
|
|
9
|
+
* and requesting result N+1 there is always at least one microtask gap. Two
|
|
10
|
+
* messages published back-to-back (e.g. two CASHED_OUT events settled in the
|
|
11
|
+
* same engine tick) used to race that gap — the second message arrived while
|
|
12
|
+
* no `next()` was pending and was silently discarded. Now every incoming
|
|
13
|
+
* message either resolves a pending pull immediately or is queued in arrival
|
|
14
|
+
* order until the next pull (the standard push/pull-queue pattern from
|
|
15
|
+
* graphql-subscriptions' PubSubAsyncIterator).
|
|
16
|
+
*
|
|
17
|
+
* Also fixed relative to the previous implementation:
|
|
18
|
+
* - a subscription id of 0 (the first id NatsPubSub hands out) was treated
|
|
19
|
+
* as "not subscribed", causing a duplicate subscription on every `next()`;
|
|
20
|
+
* the subscription is now tracked by promise, not by truthiness of the id.
|
|
21
|
+
* - two concurrent first `next()` calls could each open a subscription; the
|
|
22
|
+
* shared promise makes the subscription happen exactly once.
|
|
23
|
+
* - `return()` now drains pending pulls with `done: true` so the GraphQL
|
|
24
|
+
* layer's cleanup never hangs on an unresolved `next()`.
|
|
25
|
+
*/
|
|
4
26
|
class PubSubAsyncIterator {
|
|
5
27
|
constructor(pubsub, triggers) {
|
|
6
28
|
this.pubsub = pubsub;
|
|
7
29
|
this.triggers = triggers;
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
this.rejectPromise = reject;
|
|
13
|
-
});
|
|
30
|
+
this.pullQueue = [];
|
|
31
|
+
this.pushQueue = [];
|
|
32
|
+
this.running = true;
|
|
33
|
+
this.subscriptionPromise = null;
|
|
14
34
|
}
|
|
15
35
|
async next() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
36
|
+
await this.subscribeOnce();
|
|
37
|
+
if (!this.running) {
|
|
38
|
+
return { value: undefined, done: true };
|
|
39
|
+
}
|
|
40
|
+
if (this.pushQueue.length) {
|
|
41
|
+
return { value: this.pushQueue.shift(), done: false };
|
|
23
42
|
}
|
|
24
43
|
return new Promise((resolve) => {
|
|
25
|
-
|
|
26
|
-
this.listeners = this.listeners.filter((l) => l !== listener);
|
|
27
|
-
resolve({ value, done: false });
|
|
28
|
-
};
|
|
29
|
-
this.listeners.push(listener);
|
|
44
|
+
this.pullQueue.push(resolve);
|
|
30
45
|
});
|
|
31
46
|
}
|
|
32
47
|
async return() {
|
|
33
|
-
|
|
34
|
-
await this.pubsub.unsubscribe(this.subscriptionId);
|
|
35
|
-
this.subscriptionId = null;
|
|
36
|
-
}
|
|
48
|
+
await this.shutdown();
|
|
37
49
|
return { value: undefined, done: true };
|
|
38
50
|
}
|
|
39
51
|
async throw(error) {
|
|
40
|
-
|
|
41
|
-
await this.pubsub.unsubscribe(this.subscriptionId);
|
|
42
|
-
this.subscriptionId = null;
|
|
43
|
-
}
|
|
52
|
+
await this.shutdown();
|
|
44
53
|
return Promise.reject(error);
|
|
45
54
|
}
|
|
46
55
|
[Symbol.asyncIterator]() {
|
|
47
56
|
return this;
|
|
48
57
|
}
|
|
58
|
+
/** Subscribe exactly once, no matter how many `next()` calls race here. */
|
|
59
|
+
subscribeOnce() {
|
|
60
|
+
if (!this.subscriptionPromise) {
|
|
61
|
+
const trigger = Array.isArray(this.triggers)
|
|
62
|
+
? this.triggers[0]
|
|
63
|
+
: this.triggers;
|
|
64
|
+
this.subscriptionPromise = this.pubsub.subscribe(trigger, async (message) => this.pushValue(message));
|
|
65
|
+
}
|
|
66
|
+
return this.subscriptionPromise;
|
|
67
|
+
}
|
|
68
|
+
/** Hand the message to a pending pull, or buffer it in arrival order. */
|
|
69
|
+
pushValue(message) {
|
|
70
|
+
if (!this.running) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const resolve = this.pullQueue.shift();
|
|
74
|
+
if (resolve) {
|
|
75
|
+
resolve({ value: message, done: false });
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.pushQueue.push(message);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async shutdown() {
|
|
82
|
+
if (!this.running) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.running = false;
|
|
86
|
+
for (const resolve of this.pullQueue) {
|
|
87
|
+
resolve({ value: undefined, done: true });
|
|
88
|
+
}
|
|
89
|
+
this.pullQueue.length = 0;
|
|
90
|
+
this.pushQueue.length = 0;
|
|
91
|
+
if (this.subscriptionPromise) {
|
|
92
|
+
const pending = this.subscriptionPromise;
|
|
93
|
+
this.subscriptionPromise = null;
|
|
94
|
+
const subscriptionId = await pending.catch(() => null);
|
|
95
|
+
if (subscriptionId !== null && subscriptionId !== undefined) {
|
|
96
|
+
await this.pubsub.unsubscribe(subscriptionId);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
49
100
|
}
|
|
50
101
|
exports.PubSubAsyncIterator = PubSubAsyncIterator;
|
|
51
102
|
//# sourceMappingURL=pubsub-async-iterator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pubsub-async-iterator.js","sourceRoot":"","sources":["../../src/services/pubsub-async-iterator.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;
|
|
1
|
+
{"version":3,"file":"pubsub-async-iterator.js","sourceRoot":"","sources":["../../src/services/pubsub-async-iterator.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,mBAAmB;IAM9B,YACU,MAA2B,EAC3B,QAA2B;QAD3B,WAAM,GAAN,MAAM,CAAqB;QAC3B,aAAQ,GAAR,QAAQ,CAAmB;QAP7B,cAAS,GAA+C,EAAE,CAAC;QAC3D,cAAS,GAAQ,EAAE,CAAC;QACpB,YAAO,GAAG,IAAI,CAAC;QACf,wBAAmB,GAA2B,IAAI,CAAC;IAKxD,CAAC;IAEJ,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAE3B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,EAAE,KAAK,EAAE,SAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACjD,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO,EAAE,KA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{
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/rxdi/nats"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@nats-io/transport-node": "^3.4.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@rxdi/core": "^0.7.
|
|
37
|
+
"@rxdi/core": "^0.7.250",
|
|
38
38
|
"@types/node": "^25.0.3",
|
|
39
39
|
"tslint": "^5.20.1",
|
|
40
40
|
"tslint-language-service": "^0.9.9",
|