@sentio/runtime 2.59.0-rc.41 → 2.59.0-rc.43
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/lib/processor-runner.js +18 -4
- package/lib/processor-runner.js.map +1 -1
- package/lib/service-worker.js +19 -6
- package/lib/service-worker.js.map +1 -1
- package/package.json +1 -1
- package/src/service-manager.ts +20 -4
- package/src/service-worker.ts +20 -16
package/lib/processor-runner.js
CHANGED
@@ -26336,10 +26336,15 @@ var ServiceManager = class extends ProcessorServiceImpl {
|
|
26336
26336
|
this.contexts.delete(processId);
|
26337
26337
|
}
|
26338
26338
|
});
|
26339
|
-
|
26340
|
-
|
26341
|
-
|
26342
|
-
|
26339
|
+
try {
|
26340
|
+
await this.pool.run(
|
26341
|
+
{ request: request3, workerPort: context2.workerPort, processId },
|
26342
|
+
{ transferList: [context2.workerPort] }
|
26343
|
+
);
|
26344
|
+
} catch (err) {
|
26345
|
+
console.error("Error processing request:", err);
|
26346
|
+
subject.error(err);
|
26347
|
+
}
|
26343
26348
|
} else {
|
26344
26349
|
const context2 = this.contexts.get(processId);
|
26345
26350
|
if (!context2) {
|
@@ -26362,6 +26367,15 @@ var ServiceManager = class extends ProcessorServiceImpl {
|
|
26362
26367
|
if (this.pool) {
|
26363
26368
|
await this.pool.close();
|
26364
26369
|
}
|
26370
|
+
if (this.enablePartition) {
|
26371
|
+
const concurrent = parseInt(process.env["PROCESS_CONCURRENCY"] || "0");
|
26372
|
+
if (this.options.worker < concurrent) {
|
26373
|
+
console.warn(
|
26374
|
+
`When partition is enabled, the worker count must >= 'PROCESS_CONCURRENCY', will set worker count to ${concurrent})`
|
26375
|
+
);
|
26376
|
+
this.options.worker = concurrent;
|
26377
|
+
}
|
26378
|
+
}
|
26365
26379
|
console.info("Initializing worker pool with worker count:", this.options.worker);
|
26366
26380
|
this.pool = new Piscina({
|
26367
26381
|
maxThreads: this.options.worker,
|