Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 days ago
JSON representation

QueueT - Dead simple, Redis-based, message broker for Node.js

Awesome Lists containing this project

README

        

# Dead Simple, Redis-Based, Message Broker for Node.js

npm Version
npm Version
Code Factor
Star this repo
Follow me on

## 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);
};

```