0.0.2 • Published 4 years ago

async-cs v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Asynchronous client server communication library based on RabbitMQ.

install

yarn add async-cs

server side

const { createConnection, register } = require('async-cs');


const connection = await createConnection('localhost');

register(connection, "service/add", (req, res) => {
    const { a, b } = req;
    res({ result: a + b });
});

client side

const { createConnection, request } = require('async-cs');

const connection = await createConnection('localhost');

let res = await request(connection, "service/add", { a: 3, b: 5 });

console.log(res) //res  :   { result: 8 }
0.0.2

4 years ago

0.0.1

4 years ago