mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added worker pools, and very very basic workers
This commit is contained in:
parent
771959ec2b
commit
f5f3b51eee
5 changed files with 211 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue