qrusty-client
v0.4.0
Published
Node.js client for the qrusty priority queue server API.
Downloads
321
Readme
qrusty-client
Node.js client for the qrusty priority queue server API.
Features
- Connect to a qrusty server
- Publish, consume, ack, and purge messages
- List and manage queues
- Promise-based API using axios
Installation
npm install qrusty-clientUsage
const QrustyClient = require("qrusty-client");
const client = new QrustyClient("http://localhost:6784");
(async () => {
await client.createQueue("orders", "MaxFirst", true);
await client.publish("orders", 100, { order_id: 123 });
const msg = await client.consume("orders", "worker-1");
if (msg) {
await client.ack("orders", msg.id, "worker-1");
}
})();Documentation
Generate HTML docs with:
npm run docsTesting
Run unit tests with:
npm testPublishing
Log in to npm (if you haven't):
npm loginPublish the package:
npm publish
Credentials Needed
- You need an npm account (https://www.npmjs.com/)
- Run
npm loginand enter your username, password, and email - This stores your credentials in
~/.npmrcfor publishing
License
MIT
