Skip to content

Using it to deal with the socket multi process problem.

Notifications You must be signed in to change notification settings

SunGg12138/redis-request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-request

I'm now using it to deal with the socket multi process problem.

Install

$ npm install redis-request

How to use

const RedisRequest = require('redis-request');
const redisRequest = RedisRequest(new Redis(), new Redis());
redisRequest.extends({ broadcast: require('./test/extends/broadcast') });

redisRequest.onerror = function(error){
  console.log(error);
};

// 所有进程都能收到这次广播事件,redisRequest.broadcast.onmessage可以收到事件
redisRequest.broadcast('join', { userName: '小王', user_id: '123456789', sex: 0 });

Document

更多

Example

The example for socket.io multi process.

  1. socket.io clients

  2. socket.io broadcast

  3. socket.io emit

  4. socket.io clientsAsync

Test

$ mocha

About

Using it to deal with the socket multi process problem.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published