How to use the node-ipc.klyngLocal function in node-ipc

To help you get started, we’ve selected a few node-ipc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Mostafa-Samir / klyng / lib / router.js View on Github external
function routeToParent(message) {
    if(meta_routing_table.parent === 'local') {
        // fall to common ipc instance if klyng's is not there (happens in unit tests)
        ipc = ipc.klyngLocal || ipc;
        if(!monitor_socket.destroyed) {
            ipc.server.emit(monitor_socket, 'MONITOR:MSG', message);
        }
    }
    else {
        if(!!monitor_socket && !monitor_socket.socket.destroyed) {
            monitor_socket.emit('MONITOR:MSG', message);
        }
    }
}

node-ipc

A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis