@forzalabs/remora 0.1.1-nasco.3 → 0.1.3-nasco.3
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/Constants.js +1 -1
- package/engines/dataset/ParallelDataset.js +20 -3
- package/package.json +1 -1
package/Constants.js
CHANGED
|
@@ -17,8 +17,24 @@ const Affirm_1 = __importDefault(require("../../core/Affirm"));
|
|
|
17
17
|
const Environment_1 = __importDefault(require("../Environment"));
|
|
18
18
|
const workerpool_1 = __importDefault(require("workerpool"));
|
|
19
19
|
const DatasetManager_1 = __importDefault(require("./DatasetManager"));
|
|
20
|
+
const path_1 = __importDefault(require("path"));
|
|
20
21
|
class ParallelDatasetClass {
|
|
21
22
|
constructor() {
|
|
23
|
+
this._getWorkerPath = () => {
|
|
24
|
+
// Get the current file's directory
|
|
25
|
+
const currentDir = __dirname;
|
|
26
|
+
// Check if we're in a published npm package (no .build in path)
|
|
27
|
+
if (!currentDir.includes('.build')) {
|
|
28
|
+
// We're in the published package, workers are relative to package root
|
|
29
|
+
// __dirname is something like: /path/to/package/engines/dataset
|
|
30
|
+
// We need to go up to package root and then to workers
|
|
31
|
+
return path_1.default.join(__dirname, '../../workers');
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// We're in development, workers are in ./.build/workers
|
|
35
|
+
return path_1.default.resolve('./.build/workers');
|
|
36
|
+
}
|
|
37
|
+
};
|
|
22
38
|
this._scopeWork = (dataset) => {
|
|
23
39
|
var _a;
|
|
24
40
|
const datasetCount = dataset.getCount();
|
|
@@ -133,9 +149,10 @@ class ParallelDatasetClass {
|
|
|
133
149
|
dataset._finishOperation('transform-parallel');
|
|
134
150
|
return dataset;
|
|
135
151
|
});
|
|
136
|
-
|
|
137
|
-
this.
|
|
138
|
-
this.
|
|
152
|
+
const workerPath = this._getWorkerPath();
|
|
153
|
+
this._filterPool = workerpool_1.default.pool(path_1.default.join(workerPath, 'FilterWorker.js'));
|
|
154
|
+
this._projectionPool = workerpool_1.default.pool(path_1.default.join(workerPath, 'ProjectionWorker.js'));
|
|
155
|
+
this._transformPool = workerpool_1.default.pool(path_1.default.join(workerPath, 'TransformWorker.js'));
|
|
139
156
|
}
|
|
140
157
|
}
|
|
141
158
|
const ParallelDataset = new ParallelDatasetClass();
|