New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nerimity/mimiqueue

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nerimity/mimiqueue

NodeJS group queuing library. Requires Redis.

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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/mimiqueue

Usage

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();

FAQs

Package last updated on 02 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc