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

@cobee/queue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cobee/queue

The simplest queue abstraction

  • 1.1.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-81.33%
Maintainers
1
Weekly downloads
 
Created
Source

@cobee/queue

Just a queue abstraction library with a minimalist approach.

Installation

From Git

  npm install git@gitlab.com:cobee/payments/queue-client.git

From private registry

🚧 Not yet

Documentation

SQS

import { SQSClient } from '@aws-sdk/client-sqs';
import { SQS, QueueConfig } from '@cobee/queue';

interface MyPayload {
    id: string;
    timestamp: number;
}

const getId = () => Math.random().toString(15).substr(2);

async function main() {
    const sqsClient = new SQSClient({
        endpoint: AWS_ENDPOINT,
        region: AWS_REGION,
        credentials: {
        accessKeyId: String(AWS_ACCESS_KEY_ID),
        secretAccessKey: String(AWS_SECRET_ACCESS_KEY),
        },
    });

    const config: Partial<QueueConfig> = {
        partitionKey: (job) => String(job.id),
        queueGroup: () => '*',
    };

    const sqs = new SQS<MyPayload>(QUEUE_URI, sqsClient, config);

    setInterval(() => sqs.enqueue({ id: getId(), timestamp: Date.now() }), 1e3);

    for await (const msg of sqs.consumer().start()) {
        console.log(msg);
    }
}

main();

Examples

There're some examples here to check how library works.

TODO

  • Able to send error messages
  • Abstraction layer for job handling
  • Testing

FAQs

Package last updated on 04 Jul 2023

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