-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
assuming dumb sender:
'use strict'
import MessageQueue from 'svmq'
let app = {}
const APP_IPC_KEY = 31337
const fromAPP = 100
const toAPP = 200
function start() {
try {
app = new MessageQueue(APP_IPC_KEY)
app.send = (msg) => {
app.push(Buffer.from(msg), { type: toAPP })
}
let q = 0;
while(q++ < 100000)
app.send('msg N' + q)
} catch(e) {
console.log('start failed : ' + e.message)
}
}
start()
and reciever:
'use strict'
import MessageQueue from 'svmq'
let app = {}
const APP_IPC_KEY = 31337
const fromAPP = 200
const toAPP = 100
function start() {
try {
app = new MessageQueue(APP_IPC_KEY)
app.on('data', (data) => {
console.log('rcv: ' + data.toString())
})
} catch(e) {
console.log('start failed : ' + e.message)
}
}
start()
receiver prints garbage to console
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels