@tartine/common
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -8,13 +8,7 @@ import { Message, Stan } from "node-nats-streaming"; | ||
export declare abstract class Listener<T extends Event> { | ||
/** | ||
* Abstract properties must be defined by the subclass | ||
*/ | ||
abstract subject: T["subject"]; | ||
abstract queueGroupName: string; | ||
abstract onMessage: (data: T["data"], msg: Message) => void; | ||
protected ackWait: number; | ||
protected client: Stan; | ||
/** | ||
* Protected means that the subclass can define it if it wants to | ||
*/ | ||
protected ackWait: number; | ||
constructor(client: Stan); | ||
@@ -21,0 +15,0 @@ subscriptionOptions: () => import("node-nats-streaming").SubscriptionOptions; |
@@ -7,13 +7,11 @@ "use strict"; | ||
var _this = this; | ||
/** | ||
* Protected means that the subclass can define it if it wants to | ||
*/ | ||
// Number of seconds this listener has to ack a message | ||
this.ackWait = 5 * 1000; // 5 seconds, the default one is 30 seconds | ||
this.ackWait = 5 * 1000; | ||
this.subscriptionOptions = function () { | ||
return _this.client | ||
.subscriptionOptions() | ||
.setDeliverAllAvailable() | ||
// | ||
.setManualAckMode(true) | ||
.setAckWait(_this.ackWait) | ||
// | ||
.setDeliverAllAvailable() | ||
.setDurableName(_this.queueGroupName); | ||
@@ -20,0 +18,0 @@ }; |
@@ -11,3 +11,3 @@ "use strict"; | ||
if (err) { | ||
reject(); | ||
reject(err); | ||
} | ||
@@ -14,0 +14,0 @@ resolve(); |
{ | ||
"name": "@tartine/common", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Nothing but commons", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
29294
729