index.js
function Redis(nsp){
    Adapter.call(this, nsp);

    this.uid = uid;
    this.prefix = prefix;
    this.requestsTimeout = requestsTimeout;

    this.channel = prefix + '#' + nsp.name + '#';
    this.requestChannel = prefix + '-request#' + this.nsp.name + '#';
    this.responseChannel = prefix + '-response#' + this.nsp.name + '#';
    this.requests = {};
    this.customHook = function(data, cb){ cb(null); }

    if (String.prototype.startsWith) {
      this.channelMatches = function (messageChannel, subscribedChannel) {
        return messageChannel.startsWith(subscribedChannel);
      }
    } else { // Fallback to other impl for older Node.js
      this.channelMatches = function (messageChannel, subscribedChannel) {
        return messageChannel.substr(0, subscribedChannel.length) === subscribedChannel;
      }
    }
    this.pubClient = pub;
    this.subClient = sub;

    var self = this;

    sub.psubscribe(this.channel + '*', function(err){
      if (err) self.emit('error', err);
    });

    sub.on('pmessageBuffer', this.onmessage.bind(this));

    sub.subscribe([this.requestChannel, this.responseChannel], function(err){
      if (err) self.emit('error', err);
    });

    sub.on('messageBuffer', this.onrequest.bind(this));

    function onError(err) {
      self.emit('error', err);
    }
    pub.on('error', onError);
    sub.on('error', onError);
  }
function Redis(nsp){
    Adapter.call(this, nsp);

    this.uid = uid;
    this.prefix = prefix;
    this.requestsTimeout = requestsTimeout;

    this.channel = prefix + '#' + nsp.name + '#';
    this.requestChannel = prefix + '-request#' + this.nsp.name + '#';
    this.responseChannel = prefix + '-response#' + this.nsp.name + '#';
    this.requests = {};
    this.customHook = function(data, cb){ cb(null); }

    if (String.prototype.startsWith) {
      this.channelMatches = function (messageChannel, subscribedChannel) {
        return messageChannel.startsWith(subscribedChannel);
      }
    } else { // Fallback to other impl for older Node.js
      this.channelMatches = function (messageChannel, subscribedChannel) {
        return messageChannel.substr(0, subscribedChannel.length) === subscribedChannel;
      }
    }
    this.pubClient = pub;
    this.subClient = sub;

    var self = this;

    sub.psubscribe(this.channel + '*', function(err){
      if (err) self.emit('error', err);
    });

    sub.on('pmessageBuffer', this.onmessage.bind(this));

    sub.subscribe([this.requestChannel, this.responseChannel], function(err){
      if (err) self.emit('error', err);
    });

    sub.on('messageBuffer', this.onrequest.bind(this));

    function onError(err) {
      self.emit('error', err);
    }
    pub.on('error', onError);
    sub.on('error', onError);
  }
function Redis ( nsp ) { Adapter . call ( this , nsp ) ; this . uid = uid ; this . prefix = prefix ; this . requestsTimeout = requestsTimeout ; this . channel = prefix + '#' + nsp . name + '#' ; this . requestChannel = prefix + '-request#' + this . nsp . name + '#' ; this . responseChannel = prefix + '-response#' + this . nsp . name + '#' ; this . requests = { } ; this . customHook = function ( data , cb ) { cb ( null ) ; } if ( String . prototype . startsWith ) { this . channelMatches = function ( messageChannel , subscribedChannel ) { return messageChannel . startsWith ( subscribedChannel ) ; } } else { // Fallback to other impl for older Node.js this . channelMatches = function ( messageChannel , subscribedChannel ) { return messageChannel . substr ( 0 , subscribedChannel . length ) === subscribedChannel ; } } this . pubClient = pub ; this . subClient = sub ; var self = this ; sub . psubscribe ( this . channel + '*' , function ( err ) { if ( err ) self . emit ( 'error' , err ) ; } ) ; sub . on ( 'pmessageBuffer' , this . onmessage . bind ( this ) ) ; sub . subscribe ( [ this . requestChannel , this . responseChannel ] , function ( err ) { if ( err ) self . emit ( 'error' , err ) ; } ) ; sub . on ( 'messageBuffer' , this . onrequest . bind ( this ) ) ; function onError ( err ) { self . emit ( 'error' , err ) ; } pub . on ( 'error' , onError ) ; sub . on ( 'error' , onError ) ; }
Adapter constructor.

@param {String} namespace name
@api public
Adapter constructor .