Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(session): use socket.io rooms for emitToUsers
This refactor allows deployd to scale socket.io across multiple nodes by not tying emitToUsers to internal state, but instead tying sockets to their uids using socket.io room functionality. It should also fix a small memory leak with an event emitter. Also, it adds new functionality in the form of additional configuration options: Example: ```javascript var redisAdapter = require('socket.io-redis'); var server = deployd({ port: process.env.PORT || 1337, ... socketIo: { options: { transports: ['websocket'], }, adapter: redisAdapter({ host: 'localhost', port: 6379 }), }, }); ```
- Loading branch information
1 parent
3ab6533
commit ee1fe6d
Showing
3 changed files
with
125 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.