Added worker pools, and very very basic workers

This commit is contained in:
mrfry 2020-12-18 21:32:43 +01:00
parent 771959ec2b
commit f5f3b51eee
5 changed files with 211 additions and 5 deletions

View file

@ -290,4 +290,16 @@ if (certsLoaded) {
logger.Log('Https not avaible')
}
// app.listen(port)
console.log('hai')
import { init, doALongTask } from './utils/workerPool'
init()
setTimeout(() => {
doALongTask(1, {
type: 'work',
add: 1,
index: 1,
}).then((res) => {
console.log('woohoo!')
console.log(res)
})
}, 6000)