dolphindb 2.0.509 → 2.0.510
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/browser.js +24 -19
- package/browser.js.map +1 -1
- package/index.js +24 -19
- package/index.js.map +1 -1
- package/package.json +2 -2
package/browser.js
CHANGED
|
@@ -1574,25 +1574,30 @@ class DDB {
|
|
|
1574
1574
|
catch { }
|
|
1575
1575
|
// 临界区结束,只有一个 rpc 函数调用运行到这里,可以独占 this.on_message 然后写 WebSocket
|
|
1576
1576
|
this.on_message = ({ data: buffer }) => {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1577
|
+
try {
|
|
1578
|
+
const buf = new Uint8Array(buffer);
|
|
1579
|
+
if (this.print_message_buffer)
|
|
1580
|
+
console.log(buf);
|
|
1581
|
+
const message = this.parse_message(buf, parse_object);
|
|
1582
|
+
listener?.(message, this);
|
|
1583
|
+
for (const listener of _handlers)
|
|
1584
|
+
listener(message, this);
|
|
1585
|
+
const { type, data } = message;
|
|
1586
|
+
switch (type) {
|
|
1587
|
+
case 'print':
|
|
1588
|
+
if (this.print_message)
|
|
1589
|
+
console.log(data);
|
|
1590
|
+
return;
|
|
1591
|
+
case 'object':
|
|
1592
|
+
resolve(data);
|
|
1593
|
+
return;
|
|
1594
|
+
case 'error':
|
|
1595
|
+
reject(data);
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
catch (error) {
|
|
1600
|
+
reject(error);
|
|
1596
1601
|
}
|
|
1597
1602
|
};
|
|
1598
1603
|
args = this.to_ddbobjs(args);
|