ipc: remove queue... it adds osc latency
This commit is contained in:
parent
547f66a2a2
commit
f39e5f58ae
2 changed files with 1 additions and 21 deletions
|
|
@ -6,32 +6,14 @@ var Ipc = class Ipc {
|
|||
|
||||
constructor() {
|
||||
|
||||
this.queue = []
|
||||
this.socket = io.connect('/', {parser:customParser})
|
||||
|
||||
setInterval(this.flush.bind(this), 5)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
flush() {
|
||||
|
||||
if (this.queue.length) {
|
||||
|
||||
for (let msg of this.queue) {
|
||||
|
||||
this.socket.emit(...msg)
|
||||
}
|
||||
this.queue = []
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
send() {
|
||||
|
||||
this.queue.push(arguments)
|
||||
this.socket.emit(...arguments)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue