@openfn/engine-multi
Advanced tools
Comparing version 0.2.0 to 0.2.1
# engine-multi | ||
## 0.2.1 | ||
### Patch Changes | ||
- 5fdd699: Don't direct job logs to stdout | ||
- a6dd44b: Allow graceful termination of worker threads | ||
## 0.2.0 | ||
@@ -4,0 +11,0 @@ |
@@ -159,3 +159,3 @@ import * as _openfn_logger from '@openfn/logger'; | ||
callWorker: CallWorker; | ||
closeWorkers: () => void; | ||
closeWorkers: (instant?: boolean) => void; | ||
purge?: () => void; | ||
@@ -188,3 +188,3 @@ } | ||
listen: (workflowId: string, handlers: Record<string, EventHandler>) => void; | ||
destroy: () => void; | ||
destroy: (instant?: boolean | undefined) => void; | ||
on: (evt: string, fn: (...args: any[]) => void) => EngineAPI & { | ||
@@ -203,3 +203,3 @@ options: EngineOptions; | ||
listen: (workflowId: string, handlers: Record<string, EventHandler>) => void; | ||
destroy: () => void; | ||
destroy: (instant?: boolean | undefined) => void; | ||
}; | ||
@@ -206,0 +206,0 @@ }>; |
@@ -50,8 +50,3 @@ // src/api.ts | ||
}; | ||
engine.closeWorkers = () => { | ||
workers.terminate(true); | ||
return new Promise((done) => { | ||
setTimeout(done, 20); | ||
}); | ||
}; | ||
engine.closeWorkers = async (instant) => workers.terminate(instant); | ||
} | ||
@@ -410,3 +405,5 @@ function createWorkers(workerPath, options) { | ||
const { threadId } = event; | ||
context.logger.proxy(event.message); | ||
if (event.message.name !== "JOB") { | ||
context.logger.proxy(event.message); | ||
} | ||
context.emit(WORKFLOW_LOG, { | ||
@@ -654,3 +651,3 @@ threadId, | ||
}; | ||
const destroy = () => engine.closeWorkers(); | ||
const destroy = (instant) => engine.closeWorkers(instant); | ||
return Object.assign(engine, { | ||
@@ -657,0 +654,0 @@ options, |
{ | ||
"name": "@openfn/engine-multi", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Multi-process runtime engine", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41442
1112