1.1.6 • Published 4 years ago

omega-supreme-rooms-middleware v1.1.6

Weekly downloads
16
License
MIT
Repository
github
Last release
4 years ago

Omega Supreme Rooms Middleware

NPM version Build Status Dependencies Coverage Status

This middleware adds support for primus-rooms and automatically integrates it with metroplex if included. you MUST have primus-rooms installed.

Installation

npm install --save omega-supreme-rooms-middleware

Using the middleware

Just set the middleware in primus options so omega-primus can use it, see example below:

'use strict';

var Primus = require('primus')
  , server = require('http').createServer()
  , middleware = require('omega-supreme-rooms-middleware');

var primus = new Primus(server, {
  /* Add the options here, in the Primus's options */
});

primus.plugin('omega-supreme', require('omega-supreme'));
primus.options.middleware = middleware();

server.listen(8080);

Messaging

The middleware follows and maintains all functionality of omega-supreme. The middleware adds the ability to make requests with the following properties:

  • The rooms property can be an array or a string of room names. Message will be broadcasted to all the sparks connected to the rooms.
  • The except property can be an array or a string of spark ids. Message will not be broadcasted to the sparks in the except property. This property will only be used when rooms property is provided

Metroplex integration

The middleware automatically handles metroplex. If using metroplex and primus-rooms-redis-adapter.

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.9.0

7 years ago