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) => {
|
||||
let worker
|
||||
|
||||
let isFirst = true
|
||||
|
||||
function reset () {
|
||||
worker = new Worker(path.join(__dirname, 'vm.js'))
|
||||
|
||||
|
@ -25,6 +27,11 @@ io.on('connection', (socket) => {
|
|||
break
|
||||
}
|
||||
})
|
||||
|
||||
// ohio
|
||||
if (!isFirst) {
|
||||
worker.postMessage({ type: 'setFunctions', jsonArray })
|
||||
} else isFirst = false
|
||||
}
|
||||
|
||||
reset()
|
||||
|
|
Loading…
Reference in a new issue