https://github.com/tradologics/queuet
QueueT - Dead simple, Redis-based, message broker for Node.js
https://github.com/tradologics/queuet
message-broker message-queue nodejs npm pubsub redis
Last synced: 8 months ago
JSON representation
QueueT - Dead simple, Redis-based, message broker for Node.js
- Host: GitHub
- URL: https://github.com/tradologics/queuet
- Owner: tradologics
- License: apache-2.0
- Created: 2020-01-28T20:18:49.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-01-25T11:21:13.000Z (over 4 years ago)
- Last Synced: 2024-11-28T08:17:13.923Z (over 1 year ago)
- Topics: message-broker, message-queue, nodejs, npm, pubsub, redis
- Language: JavaScript
- Homepage: https://npmjs.com/@tradologics/queuet
- Size: 103 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README

# Dead Simple, Redis-Based, Message Broker for Node.js
## Install
```
$ npm install @tradologics/queuet
```
## Use
### Publisher
```javascript
const broker = require("@tradologics/queuet");
// connect to redis
broker.initialize("myqueue");
broker.publish("This is my message").then(resp => {
broker.disconnect();
process.exit(0);
}).catch(err => console.log(err));
```
### Subscriber
(starts with getting the backlog)
```javascript
const broker = require("queuet");
// connect to redis
broker.initialize("myqueue");
// handle backlog
broker.read_backlog(do_something);
// subscribe to new items
broker.subscribe(do_something);
function do_something(id, data) {
console.log(">>", id, data);
// do some processing here and remove
// the message from the queue when done
broker.delete(id);
};
```