0.1.1 • Published 5 years ago

zero-ipc v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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

0.1.1

5 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.1

6 years ago