sc-publish-out-queue

0.2.2 • Public • Published

SC Publish Out Queue

Change Log

0.2.2 - Nov 27, 2017 - Check to see if socket is connected before emiting back.

Installation

npm install sc-publish-out-queue --save

Usage

let scPublishOutHandler = require('sc-publish-out-queue')

scPublishOutHandler.attach(worker,{
	debug:true,				// Defaults to false
	timeout:100, 			// in milliseconds; defaults to 10
	numOfMessagesPerPass 	// Num of packets it will clear at a time; defaults to 100
})

Example

There is an example in the sample folder. You need to first spin up a state server and a broker. You can just clone the socketcluster repos for this if you want. Then npm start the sample folder. Open up a browser to localhost:8000. Open your dev tools and send a socket.publish('send-data',{ id:1 }) and every client that's connected will see this message only once per a publish. The system is ALIVE! Thanks!

Package Sidebar

Install

npm i sc-publish-out-queue

Weekly Downloads

0

Version

0.2.2

License

ISC

Last publish

Collaborators

  • happilymarrieddad
  • fusionwarellc