@remix_labs/hub-client 2.12923.0-dev → 2.12927.0-dev
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/common.js +4 -27
- package/package.json +1 -1
package/common.js
CHANGED
|
@@ -388,26 +388,6 @@ class Channel {
|
|
|
388
388
|
})
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
unsubscribeClient(clientName) {
|
|
392
|
-
return new Promise((resolve, reject) => {
|
|
393
|
-
let reqId = this.reqId + 1;
|
|
394
|
-
this.reqId = reqId;
|
|
395
|
-
this.expect.set(reqId, (resp => {
|
|
396
|
-
this.expect.delete(reqId);
|
|
397
|
-
if (resp.data.error == null) {
|
|
398
|
-
resolve(resp.data)
|
|
399
|
-
} else
|
|
400
|
-
reject(resp.data);
|
|
401
|
-
}));
|
|
402
|
-
let unsubMsg =
|
|
403
|
-
{ _rmx_type: "msg_hub_unsubscribeClient",
|
|
404
|
-
reqId: reqId,
|
|
405
|
-
clientName: clientName
|
|
406
|
-
};
|
|
407
|
-
this.port.postMessage(unsubMsg)
|
|
408
|
-
})
|
|
409
|
-
}
|
|
410
|
-
|
|
411
391
|
setLocalPubTopic(topic) {
|
|
412
392
|
return new Promise((resolve, reject) => {
|
|
413
393
|
let reqId = this.reqId + 1;
|
|
@@ -446,7 +426,7 @@ class Channel {
|
|
|
446
426
|
})
|
|
447
427
|
}
|
|
448
428
|
|
|
449
|
-
newChannel(
|
|
429
|
+
newChannel() {
|
|
450
430
|
return new Promise((resolve, reject) => {
|
|
451
431
|
let reqId = this.reqId + 1;
|
|
452
432
|
this.reqId = reqId;
|
|
@@ -461,8 +441,7 @@ class Channel {
|
|
|
461
441
|
}));
|
|
462
442
|
let msg =
|
|
463
443
|
{ _rmx_type: "msg_hub_newChannel",
|
|
464
|
-
reqId: reqId
|
|
465
|
-
clientName: clientName
|
|
444
|
+
reqId: reqId
|
|
466
445
|
};
|
|
467
446
|
this.port.postMessage(msg);
|
|
468
447
|
})
|
|
@@ -552,7 +531,7 @@ class Worker {
|
|
|
552
531
|
})
|
|
553
532
|
}
|
|
554
533
|
|
|
555
|
-
newChannel(
|
|
534
|
+
newChannel() {
|
|
556
535
|
let thisworker = this;
|
|
557
536
|
return new Promise((resolve, reject) => {
|
|
558
537
|
thisworker.expect.push(resp => {
|
|
@@ -564,9 +543,7 @@ class Worker {
|
|
|
564
543
|
reject(resp.data)
|
|
565
544
|
});
|
|
566
545
|
let msg =
|
|
567
|
-
{ "_rmx_type": "msg_hub_newChannel"
|
|
568
|
-
clientName: clientName
|
|
569
|
-
};
|
|
546
|
+
{ "_rmx_type": "msg_hub_newChannel" };
|
|
570
547
|
thisworker.worker.postMessage(msg);
|
|
571
548
|
})
|
|
572
549
|
}
|