Coder Social home page Coder Social logo

redisstore-docs's Introduction

Socket.IO RedisStore

Socket.io RedisStore is a remote persistent key/value storage engine for Socket.io as well as an inter-process dispatch layer for Socket.io servers. RedisStore uses Redis Pub/Sub to distribute Socket.io framed messages to the connected Socket.io servers.

Use it:

(requires socket.io >= 0.8.5):

var sio = require('socket.io')
  , RedisStore = sio.RedisStore
  , io = sio.listen()

io.configure(function () {
  io.set('store', new RedisStore)
})

Persist it:

io.sockets.on('connection', function(socket) {
  var nick = 'dshaw'
  socket.set('nickname', nick, function() {
    socket.emit('nickname', nick)
  })
})

Scale it:

Point all socket.io processes and server instances at the same Redis server.

io.configure(function () {
  io.set('store', new RedisStore({ host: 'http://redis.example.com' }))
})

Extend it:

Want to implement your own dispatch layer, but Redis for your key/value store? Totally doable. In fact, that is exactly what socket.io-zero does. Zero provides a ZeroMQ-based dispatch layer, then uses RedisStores "storage" implementation.

Example: https://github.com/dshaw/socket.io-zero

Resources:

redisstore-docs's People

Contributors

dshaw avatar

Stargazers

Maxime avatar Sungmyung Lee avatar Mathieu M-Gosselin avatar Wu Dong avatar Ryan Smith avatar  avatar Alan Plum avatar Sebastien Ballesteros avatar Will Dent avatar Flávio HG avatar  avatar Henry Allen-Tilford avatar Swift avatar  avatar Tak Tran avatar Kyle Mathews avatar  avatar Joohun, Maeng avatar Jason Arora avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

ligoou

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.