Giter VIP home page Giter VIP logo

omega-supreme-rooms-middleware's Introduction

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.

omega-supreme-rooms-middleware's People

Contributors

fadeenk avatar greenkeeper[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.