How to use the node-ipc.disconnect 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 / beacon-controller.js View on Github external
function start() {

    // close open socket if exists
    if(!!ipc.of.klyng_beacon)
        ipc.disconnect('klyng_beacon');

    var beacon_daemon = cp.spawn('node', ['lib/beacon.js'], {detached: true, stdio: 'ignore'});
    beacon_daemon.unref();

    return new Promise(function(resolve, reject) {
        setTimeout(function() {
            checkIfRunning() // this will open a new socket
            .then(function(running) {
                resolve(running);
            });
        }, 500);
    });
}
github Mostafa-Samir / klyng / tests / specs / beacon / beacon-remote.specs.js View on Github external
after(function() {
        ipc.disconnect('auth_socket');
        ipc.disconnect('nauth_socket');
        tcp.stop();
    });
github efoxbr / megacubo / assets / js / utils / indexer.js View on Github external
function terminate() {
    var debug = debugAllow(false)
    try {
        ipc.disconnect('main')
    } catch(e) {
        console.error(e)
    }
    console.log('closing', traceback())
    if(!debug){
        win.close(true)
    } else {
        console.warn('Closing prevented for debugging')
    }
}
github Mostafa-Samir / klyng / lib / cli-controller.js View on Github external
.then(function(signaled) {
        if(signaled) {
            if(signaled === 'busy') {
                console.log('The beacon is busy.');
                ipc.disconnect('klyng_beacon');
            }
            else {

                var remainingProcessesCount = job.size;

                ipc.of.klyng_beacon.on('MONITOR:MSG', function(message, socket) {

                    if(message.type === 'process:stdout') {
                        console.log(message.data.line);
                    }
                    else if(message.type === 'process:exit') {
                        remainingProcessesCount--;
                        if(!remainingProcessesCount)
                            beacon.signalDone()
                    }
                });
github Mostafa-Samir / klyng / lib / beacon-controller.js View on Github external
ipc.of.klyng_beacon.socket.on('end', function() {
            ipc.disconnect('klyng_beacon');

            _stop_timeout();
            resolve(true);
        });
    });
github luminati-io / luminati-proxy / bin / upgrader.js View on Github external
E.uninit = ()=>{
    E.uninit_traps();
    ipc.disconnect('lum_node_index');
    ipc.config.stopRetrying = true;
};
github inkandswitch / pushpin / src / apps / clipper-host / index.ts View on Github external
const timer = setTimeout(() => {
      ipc.disconnect('renderer')
      res({ type: 'Failed', details: 'Timed out.' })
    }, 2500)
    ipc.connectTo('renderer', WEBCLIPPER_SOCKET_LOCATION, () => {

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 4 months ago

Package Health Score

67 / 100
Full package analysis