2.1.3 • Published 7 months ago
@nerimity/mimiqueue v2.1.3
Mimiqueue
Free, open source NodeJS group queueing library with redis. Currently being used in https://nerimity.com (My chat app)
Features
- Cluster Support
- Redis Required
- Group Queuing
- Throttle Support (minTime)
Installation
pnpm i redis @nerimity/mimiqueueUsage
import { createQueue, createQueueProcessor } from "@nerimity/mimiqueue";
import { createClient } from "redis";
import { setTimeout } from "timers/promises";
const redisClient = createClient({
socket: {
host: "127.0.0.1",
port: 6379,
},
});
const main = async () => {
await redisClient.connect();
// NOTE:
// When running in a cluster, this needs to be ran ONCE in the main thread.
await createQueueProcessor({
redisClient,
});
const queue = createQueue({
name: "test-queue",
redisClient,
minTime: 1000,
});
queue.add(
async () => {
await setTimeout(5000);
return "done";
},
{ groupName: "someId eg ip address" }
);
const status = await queue.add(
async () => {
await setTimeout(5000);
return "done";
},
{ groupName: "someId eg ip address" }
);
console.log(status);
};
main();2.1.2
8 months ago
2.0.3
12 months ago
2.1.1
8 months ago
2.0.2
12 months ago
2.1.3
7 months ago
2.0.4
11 months ago
2.1.0
8 months ago
2.0.1
12 months ago
2.0.0
12 months ago
1.2.3
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago
1.2.0
1 year ago
1.1.1
1 year ago
1.1.0
1 year ago
1.0.3
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago