-
-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Hi there, i am starting to work with tinypools so excuse if the question is kind of stupid.
i have a node js api using bullMQ for long running tasks. within each task there are between 20 to 100 long running processes wich i want to run in parallel using tinypool. currently i do this like so:
bullmqWorker.ts:
const { Tinypool } = await importDynamic('tinypool')
const extruderWorkerPool = new Tinypool({
// filename: __dirname + '/getextruderWorkerPool.ts',
filename: new URL(
'./extruderPoolWorker.js',
require('url').pathToFileURL(__filename).toString()
).href,
runtime: 'worker_threads',
minThreads: 1,
maxThreads: 16
})
const extruderReturnPromises: Promise<ReturnType>[] = []
while (distance <= highZ + stepSize) {
extruderReturnPromises.push(extruderWorkerPool.run({
folder, polygonFile, distance, skipMesh, weightsFile
}))
distance = distance + stepSize
}
const results = await Promise.all(extruderReturnPromises)the question i have is, if it is necessary to dispose the Tinypool pool? or do i just leave it like this and once all jobs are done they are gone?
Thank you so much for clarification!
cheers!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested