socket.io-adapter-sequelize

0.0.4 • Public • Published

socket.io-adapter-sequelize

npm license dependancies dependanciesdev

Install

npm install socket.io-adapter-sequelize

How to use

var io = require('socket.io')(3000);
var SequelizeAdapter = require('socket.io-adapter-sequelize');
 
var dbconfig = {
      'database': 'test-db',
      'username': 'user',
      'password': 'pass',            
      'dialect': 'sqlite',
      'storage': 'test/test-db.sqlite',
      'logging': false
    }
 
var sequelize = new Sequelize(dbconfig)
io.adapter(SequelizeAdapter(sequelize));

API

adapter(sequelize[, opts])

sequelize is an existing connected Sequelize object.

adapter(opts)

The following options are allowed:

  • tableName: the name of the table that will be created and used within your connected database
  • processEvery: milliseconds for how often the check for new messages will be run. defaults to 1000 i.e. 1 second.

When to use

Use when you want to use a sequelize compatable database to pass events between nodes when working with clusters.

Credit

Inspired by the other socket.io adapters. Particularly the redis and rethinkdb ones. Thanks

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i socket.io-adapter-sequelize

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

8.54 kB

Total Files

5

Last publish

Collaborators

  • paulmowat