@munlib/common 1.0.8 → 1.0.9
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.
|
@@ -8,7 +8,8 @@ export declare abstract class Listener<T extends Event> {
|
|
|
8
8
|
abstract subject: T["subject"];
|
|
9
9
|
abstract onMessage(data: T["data"], msg: any): void;
|
|
10
10
|
private channel;
|
|
11
|
-
|
|
11
|
+
private durable;
|
|
12
|
+
constructor(channel: Channel, durable: boolean);
|
|
12
13
|
listen(): Promise<void>;
|
|
13
14
|
parseMessage(msg: any): any;
|
|
14
15
|
}
|
|
@@ -38,15 +38,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Listener = void 0;
|
|
40
40
|
var Listener = /** @class */ (function () {
|
|
41
|
-
function Listener(channel) {
|
|
41
|
+
function Listener(channel, durable) {
|
|
42
42
|
this.channel = channel;
|
|
43
|
+
this.durable = durable;
|
|
43
44
|
}
|
|
44
45
|
Listener.prototype.listen = function () {
|
|
45
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
46
47
|
var _this = this;
|
|
47
48
|
return __generator(this, function (_a) {
|
|
48
49
|
switch (_a.label) {
|
|
49
|
-
case 0: return [4 /*yield*/, this.channel.assertQueue(this.subject, { durable:
|
|
50
|
+
case 0: return [4 /*yield*/, this.channel.assertQueue(this.subject, { durable: this.durable })];
|
|
50
51
|
case 1:
|
|
51
52
|
_a.sent();
|
|
52
53
|
this.channel.consume(this.subject, function (msg) {
|