This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

corinth.js
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

Corinth.js

Node.js wrapper for Corinth, a Rust message queue server.

codecov CI & Coverage

Example

import { Corinth } from "corinth.js";

const hostUrl = "http://localhost:44444";
const corinth = new Corinth(hostUrl);

interface IItem {
  id: string;
}

// myQueue contains IItem objects
// This does not create the queue, just defines a model to interact with
const myQueue = corinth.defineQueue<IItem>("myQueue");

// Ensure queue exists
await myQueue.ensure();

// Enqueue an item
await myQueue.enqueueOne({ id: "abc" });

// Get one or more items from the queue
// Gets one by default
const result = await myQueue.dequeue();
const message = result[0];

// Process your item
await processItem(message.item);

// Acknowledge success
await message.ack();

Package Sidebar

Install

npm i corinth.js

Weekly Downloads

1

Version

0.5.2

License

ISC

Unpacked Size

23.1 kB

Total Files

4

Last publish

Collaborators

  • dotvirus
  • marvin-j97