# hkulekci-simple-redis-queue

> A simple redis queue using lpush and brpop

Latest version **0.9.8** (published 2023-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install hkulekci-simple-redis-queue
pnpm add hkulekci-simple-redis-queue
yarn add hkulekci-simple-redis-queue
bun add hkulekci-simple-redis-queue
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.8 |
| Published | 2023-02-02 |
| First published | 2023-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | James Smith |
| Maintainers | kulekci |

## Links

- npm: https://www.npmjs.com/package/hkulekci-simple-redis-queue
- Repository: https://github.com/hkulekci/node-simple-redis-queue
- Homepage: https://github.com/hkulekci/node-simple-redis-queue#readme
- Issues: https://github.com/hkulekci/node-simple-redis-queue/issues
- npm.io page: https://npm.io/package/hkulekci-simple-redis-queue

## Dependencies (1)

- [redis](https://npm.io/package/redis.md) ^4.6.4

## Recent versions

- 0.9.8 (latest) — 2023-02-02
- 0.9.7 — 2023-02-02
- 0.9.6 — 2023-02-02
- 0.9.5 — 2023-02-01
- 0.9.4 — 2023-02-01

## README

Simple Redis Queue for Node.js
==============================

Super simple wrapper for redis `lpush` and `brpop` commands for basic queue
processing and multiple queue support.


Usage
-----

```coffee
// Require the module
RedisQueue = require("simple-redis-queue");

// Construct a queue with a redis connection
myQueue = new RedisQueue(redisCon);

// Publish to the queue
myQueue.push("queueName", "body string or object", function(err, reply){
    console.log(err);
    console.log("current queue size : " + reply);
});

// Listen for new messages
myQueue.on("message", function (queueName, payload) {
    // Do something with the message
});

// Listen for errors
myQueue.on("error", function (error) {
    console.error(error);
});

// Start monitoring this queue
myQueue.monitor("queueName");
```

Example Syncronuous Usage
-------------------------

```coffee
// Require the module
RedisQueue = require("simple-redis-queue");

// Construct a queue with a redis connection
myQueue = new RedisQueue(redisCon);

// Publish to the queue
myQueue.push("queueName", "body string or object", function(err, reply){
    console.log(err);
    console.log("current queue size : " + reply);
});

// Listen for new messages
myQueue.on("message", function (queueName, payload) {
    // Do something with the message
    do_something(some_parameters, function(){
        // callback function
        myQueue.next("queueName");
    });
});

// Listen for errors
myQueue.on("error", function (error) {
    console.error(error);
});

// Start monitoring this queue
myQueue.next("queueName");
```

---
_Source: https://npm.io/package/hkulekci-simple-redis-queue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
