smqp
TypeScript icon, indicating that this package has built-in type declarations

8.2.2 • Public • Published

SMQP

BuildBuild statusCoverage StatusProject Status: Active – The project has reached a stable, usable state and is being actively developed.

Synchronous message queueing package. Used as an alternative, and frontend ready, event handler when you expect events to be handled in sequence.

Basically a synchronous amqp broker.

Documentation

Usage

import {Broker} from 'smqp';

const owner = {name: 'me'};
const broker = Broker(owner);

broker.subscribe('events', '#', 'event-queue', onMessage);

broker.publish('events', 'start', {arg: 1});

function onMessage(routingKey, message, brokerOwner) {
  console.log('received:', routingKey);
  console.log('with message:', message);
  console.log('owned by:', brokerOwner.name);
  message.ack();
}

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i smqp

    Weekly Downloads

    1,095

    Version

    8.2.2

    License

    MIT

    Unpacked Size

    132 kB

    Total Files

    29

    Last publish

    Collaborators

    • paed01