22 lines
416 B
JavaScript
22 lines
416 B
JavaScript
import { Socket } from '../../src'
|
|
|
|
const USOCKET = __dirname + '/test.sock'
|
|
|
|
let socket = new Socket(USOCKET,{name:'unix socket'})
|
|
|
|
let app ={}
|
|
app.pp = 'test'
|
|
app.test = async function (packet) {
|
|
packet.payload = 'using passed processor with alt name '+packet.payload
|
|
return packet
|
|
}
|
|
|
|
;
|
|
(async () => {
|
|
|
|
await socket.create(app)
|
|
|
|
})().catch(err => {
|
|
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
|
|
})
|