1.2.1 • Published 5 years ago
@heatmap/rpc v1.2.1
RPC
RPC over RabbitMQ for Node.js
Examples
Example usage of Server
:
import { Server } from "@heatmap/rpc";
const server = new Server(connection);
server.addCommand("hello", (name: string) => `Hello, ${name}!`);
await server.start();
Example usage of Client
:
import { Client } from "@heatmap/rpc";
const client = new Client(connection, { requestsQueue });
await client.start();
const response = await client.sendCommand("hello", ["Dante"]);
console.log(`Dante got hello reponse ${response}`);
Acknowledgements
This module was originally a fork of elasticio/amqp-rpc but has now been completely rewritten for TypeScript usage.
License
This module is licensed under the MIT license.