0.0.2 • Published 7 years ago

durga-rooms-nats v0.0.2

Weekly downloads
8
License
-
Repository
github
Last release
7 years ago

durga-rooms-nats

RoomProxy for Durga using nats.io as transport and distribution layer.

Install

npm install --save durga-rooms-nats

Usage

const Durga = require('durga');
const NatsRooms = require('durga-rooms-nats');

const server = new Durga.Server({ ... });

server.roomProxy('nats', new NatsRooms({
	
	// will be passed through to nats.connect(options)
	nats: { ... },
	
	// proxy will publish to durga.rooms.[roomName]
	topicPrefix: 'durga.rooms' // -> default

}));

// define room
server.room('foo', 'nats');

// use room
server.room('foo').emit('my-event', { my: 'payload' });
0.0.2

7 years ago

0.0.1

7 years ago