0.5.2 • Published 3 years ago

corinth.js v0.5.2

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

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

3 years ago

0.3.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.5.1

3 years ago

0.1.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.0.1

4 years ago