Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.
/ redisq Public archive

Redisq is an asynchronous task executor(worker) built for nodejs based on node-redis.

License

Notifications You must be signed in to change notification settings

kartik1998/redisq

Repository files navigation

REDISQ

Redisq is a redis backed queue, message broker for node js

Usage

  • Installation : npm i https://github.com/kartik1998/redisq.git#v0.0.0

To send a message: (send.js)

const RedisQ = require('redisq');

const redisq = new RedisQ();
redisq.sendToQueue('world', 'my first message', (err, data) => {
  console.log(data);
  process.exit();
});

Sample output : OK

To recieve message: (recieve.js)

const RedisQ = require('redisq');

const redisq = new RedisQ();
redisq.consume('world', (channel, message) => {
  console.log('queueName ->', channel);
  console.log('message ->', message);
});

Sample output:

queueName -> world
message -> my first message
Please note that the messages that aren't consumed are persisted in redis and are consumed later on by a queue consumer.
Redisq by default connects to 127.0.0.1:6379.
You can use your own specific options by using something like const redisq = new RedisQ({options}). refer: https://www.npmjs.com/package/redis

About

Redisq is an asynchronous task executor(worker) built for nodejs based on node-redis.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published