mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 01:31:05 +03:30
32 lines
551 B
JavaScript
Vendored
32 lines
551 B
JavaScript
Vendored
const fs = require('fs');
|
|
const ipc = require('../../node-ipc');
|
|
|
|
const socketPath = '/tmp/ipc.sock';
|
|
|
|
//loop forever so you can see the pid of the cluster sever change in the logs
|
|
setInterval(
|
|
function() {
|
|
ipc.connectTo(
|
|
'world',
|
|
socketPath,
|
|
connecting
|
|
);
|
|
},
|
|
2000
|
|
);
|
|
|
|
function connecting(socket) {
|
|
ipc.of.world.on(
|
|
'connect',
|
|
function() {
|
|
ipc.of.world.emit(
|
|
'currentDate',
|
|
{
|
|
message: new Date().toISOString()
|
|
}
|
|
);
|
|
ipc.disconnect('world');
|
|
}
|
|
);
|
|
}
|