A package for creating communication between microservices based on RabbitMQ.
(async () => {
const rpc = await require('./src')('amqp://localhost')
rpc.register('hello', user => `Hello ${user}`);
rpc.start();
rpc.call('hello', 'john).then(response => {
console.log(response);
});
})().catch(e => console.log(e))
async call(handler: string, ...args: any[]) => Promise<any>
Emit new request
register (event: string, callback: (...args: any[]) => any) => void
Register new callback
async start() => Promise<void>
Start listen for new requests. Use this after register events.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Dominik Szamburski - Initial work - nulxrd
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details