can
This commit is contained in:
parent
b13456c9c8
commit
a3ab6e672f
1 changed files with 7 additions and 0 deletions
7
index.js
7
index.js
|
@ -10,6 +10,8 @@ const io = new Server(3069)
|
||||||
io.on('connection', (socket) => {
|
io.on('connection', (socket) => {
|
||||||
let worker
|
let worker
|
||||||
|
|
||||||
|
let isFirst = true
|
||||||
|
|
||||||
function reset () {
|
function reset () {
|
||||||
worker = new Worker(path.join(__dirname, 'vm.js'))
|
worker = new Worker(path.join(__dirname, 'vm.js'))
|
||||||
|
|
||||||
|
@ -25,6 +27,11 @@ io.on('connection', (socket) => {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// ohio
|
||||||
|
if (!isFirst) {
|
||||||
|
worker.postMessage({ type: 'setFunctions', jsonArray })
|
||||||
|
} else isFirst = false
|
||||||
}
|
}
|
||||||
|
|
||||||
reset()
|
reset()
|
||||||
|
|
Loading…
Reference in a new issue