landscape: channel.js plumbing acks through for subscriptions

This commit is contained in:
David Kerschner 2020-09-25 15:35:12 -07:00
parent 9c8f2ae0ff
commit a07757c313

View File

@ -103,14 +103,16 @@ class Channel {
path,
connectionErrFunc = () => {},
eventFunc = () => {},
quitFunc = () => {}) {
quitFunc = () => {},
subAckFunc = () => {}) {
let id = this.nextId();
this.outstandingSubscriptions.set(
id,
{
err: connectionErrFunc,
event: eventFunc,
quit: quitFunc
quit: quitFunc,
subAck: subAckFunc
}
);
@ -210,6 +212,9 @@ class Channel {
if (obj.hasOwnProperty("err")) {
funcs["err"](obj.err);
this.outstandingSubscriptions.delete(obj.id);
} else if (obj.hasOwnProperty("ok")) {
funcs["subAck"](obj);
this.outstandingSubscriptions.delete(obj.id);
}
} else if (obj.response == "diff") {
let funcs = subFuncs;