zero-ipc
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    Zero IPC

    Fastest IPC communication module

    Greenkeeper badge NPM Version Build Status

    Fastest IPC communication module

    Motivation

    When creating multiple processes on the machine there is the need for the these processes to comunicate.

    High level communication can be established using http for example. The problem with such protocol is the they add another layer of parsing and overheads.

    Zero IPC enables low level commiucation with almost no overheads using unix sockets files. IPC - internal process communication.

    Over that low level communication there is also a simple async rpc helpers with promises as a response.

    Bonus it allow more than one client for each socket created by server.

    Example

    More examples can be found in the integration tests. Also in the integration you will find an integration with RX observables.

        const {IPCClient , IPCServer} = require('zero-ipc');
        const unixPathPrefix = './test-ipc';
     
        const server = new IPCServer((connection)=>{
        })
        server.on('request' , function(message){
            message.replay('hi');
        })
        server.listen({
            removeOpenFiles : true,
            in : unixPathPrefix+".in.sock",
            out : unixPathPrefix+".out.sock"
        })
        const client = new IPCClient({
            out : unixPathPrefix+".in.sock",
            in : unixPathPrefix+".out.sock"
        } , ()=>{
     
        })
     
        IPCClient.promiseSendWithReplay(client , 'test1' , 100)
        .then((message)=>{
            console.log(message.toString());
            //hi
        })

    License

    MIT

    Install

    npm i zero-ipc

    DownloadsWeekly Downloads

    6

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    31.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • hiscojs