@remix_labs/hub-client 2.12974.0-dev → 2.12978.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 +11 -1
- package/package.json +1 -1
package/common.js
CHANGED
|
@@ -299,7 +299,7 @@ class Channel {
|
|
|
299
299
|
this.port.onmessage = (ev => {
|
|
300
300
|
try {
|
|
301
301
|
let f = this.expect.get(ev.data.reqId);
|
|
302
|
-
if (ev.eof) {
|
|
302
|
+
if (ev.data.eof) {
|
|
303
303
|
this.expect.delete(ev.data.reqId);
|
|
304
304
|
};
|
|
305
305
|
f(ev);
|
|
@@ -447,6 +447,16 @@ class Channel {
|
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
newChannel(clientName) {
|
|
450
|
+
// regarding clientName: by adding a clientName to a
|
|
451
|
+
// channel all requests are associated with this
|
|
452
|
+
// name. Keep in mind how a VM is started:
|
|
453
|
+
// - first, a channel is created
|
|
454
|
+
// - then, the worker starts up
|
|
455
|
+
// - then, the port of the channel is sent to the worker
|
|
456
|
+
// - this port is then used by the worker for all requests sent
|
|
457
|
+
// to the messaging hub
|
|
458
|
+
// This way, all requests submitted from the worker are associated
|
|
459
|
+
// with the clientName.
|
|
450
460
|
return new Promise((resolve, reject) => {
|
|
451
461
|
let reqId = this.reqId + 1;
|
|
452
462
|
this.reqId = reqId;
|