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/index.js
CHANGED
|
@@ -1585,25 +1585,30 @@ class DDB {
|
|
|
1585
1585
|
catch { }
|
|
1586
1586
|
// 临界区结束,只有一个 rpc 函数调用运行到这里,可以独占 this.on_message 然后写 WebSocket
|
|
1587
1587
|
this.on_message = ({ data: buffer }) => {
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1588
|
+
try {
|
|
1589
|
+
const buf = new Uint8Array(buffer);
|
|
1590
|
+
if (this.print_message_buffer)
|
|
1591
|
+
console.log((0, utils_js_1.typed_array_to_buffer)(buf));
|
|
1592
|
+
const message = this.parse_message(buf, parse_object);
|
|
1593
|
+
listener?.(message, this);
|
|
1594
|
+
for (const listener of _handlers)
|
|
1595
|
+
listener(message, this);
|
|
1596
|
+
const { type, data } = message;
|
|
1597
|
+
switch (type) {
|
|
1598
|
+
case 'print':
|
|
1599
|
+
if (this.print_message)
|
|
1600
|
+
console.log(data);
|
|
1601
|
+
return;
|
|
1602
|
+
case 'object':
|
|
1603
|
+
resolve(data);
|
|
1604
|
+
return;
|
|
1605
|
+
case 'error':
|
|
1606
|
+
reject(data);
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
catch (error) {
|
|
1611
|
+
reject(error);
|
|
1607
1612
|
}
|
|
1608
1613
|
};
|
|
1609
1614
|
args = this.to_ddbobjs(args);
|