Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.26 KB

Readme.md

File metadata and controls

45 lines (31 loc) · 1.26 KB

Foreks Logo

Foreks publisher subscriber connection class

import pubsubConnector  from 'pubsub-connector';

const options: PubSubConnectionOptions = {
    username: '', // socket username
    password: '', // socket password
    resource: '', // socket resource
    url: '', // socket url
    messageEvent: () => {} , // message event callback function
    isReconnection: false // is reconnection default is false
    autoReconnect: true // auto reconnect on error or on close 
    reConnectInterval: 5000, // auto reconnect interval
}

await pubsubConnector.connect(options);

or 

pubsubConnector.connect(options).then(socket => {

});

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm i pubsub-connector -s