-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1119 from finos/fix-postmessage
Fix transferable list in worker.postMessage
- Loading branch information
Showing
6 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2019, the Perspective Authors. | ||
* | ||
* This file is part of the Perspective library, distributed under the terms of | ||
* the Apache License 2.0. The full license can be found in the LICENSE file. | ||
* | ||
*/ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
/** | ||
* Returns an `ArrayBuffer` containing the contents of a `.arrow` file | ||
* located at `arrow_path`. | ||
* | ||
* Because `fs.readFileSync` shares its underlying buffer | ||
* between calls to `readFileSync`, we need to get a slice | ||
* of the `ArrayBuffer` specifically at its byte offset. | ||
* | ||
* See https://github.com/nodejs/node/issues/11132 for more details. | ||
* | ||
* @param arrow_path {String} a path to an arrow file. | ||
* @returns {ArrayBuffer} an ArrayBuffer containing the arrow-serialized data. | ||
*/ | ||
function load_arrow(arrow_path) { | ||
const data = fs.readFileSync(arrow_path); | ||
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength); | ||
} | ||
|
||
const int_float_str_arrow = load_arrow(path.join(__dirname, "..", "arrow", "int_float_str.arrow")); | ||
|
||
module.exports = { | ||
int_float_str_arrow | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters