Redis Priority Queue
This is a simple Promise based multi-channel priority queue implementation that leverages Redis sorted set.
You will need Redis server running.
npm install redis-priority-queueyarn add redis-priority-queue
The test script in
package.json preprocesses the
.ts file and then executes.
npm run build). You can use in ES5 or later supported environments. The following code snippets are implemented in the
Quick start (Node)
const queue = ;const config = queue;const myQueue = config;myQueuelength"emptyQueue";
Optional with existing client
If you already have a program with a
RedisClient you can pass the client as an optional second parameter.
const myQueue = null client;myQueuelength"emptyQueue";
Pull highest score element
Peek highest score element
Check if empty
Get queue length
I haven't thought that far ahead yet. I needed this for my project and wanted to give back. ;-)
MIT (if you enhance it, fork and PR so the community benefits)