0.0.4 • Published 4 years ago

queuet v0.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

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

Install

$ npm install queuet

Use

Publisher

const broker = require("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)

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

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago