seneca-muxer

1.0.9 • Public • Published

Seneca

A Seneca.js Event and Message Muxing Plugin

seneca-muxer

npm version Travis Dependency Status

Lead Maintainers: Tobias Gurtzick and Christian Wolf

seneca-muxer

This module is a plugin for the Seneca framework. It provides muxing capabilities to combine different messages and events into a single event that an indefinite amount of clients listens to. This shal help when synchronizing asynchrounus actions coming from across your microservice landscape.

Usage

To use the muxer first install the module via

npm i -s seneca-muxer

Next you will need a driver, for example a redis driver:

npm i -s seneca-muxer-redis

Now you can require the plugin and use it, like in the following example:

'use strict';
 
const seneca = require('seneca');
seneca.use('muxer', {
  driver: 'seneca-muxer-redis'
});
 
seneca.act('muxer:register', {
  events: [
    'simple:event',
    'another:event'
  ],
  optionalEvents: [
    'event:that,is:optional'
  ],
  fires: 'on:fire',
  maxRequestTime: 2000
});

Package Sidebar

Install

npm i seneca-muxer

Weekly Downloads

1

Version

1.0.9

License

MIT

Last publish

Collaborators

  • wzrdtales