-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[perf] Use pattern matching at the namespace level (#217)
This follows #46. Each node will now listen to only three channels: - `socket.io#<namespace>#*`: used when broadcasting - `socket.io-request#<namespace>#`: used for requesting information (ex: get every room in the cluster) - `socket.io-response#<namespace>#`: used for responding to requests We keep the benefits of #46 since: - messages from other namespaces are ignored - when emitting to a single room, the message is sent to `socket.io#<namespace>#<my-room>`, so listeners can check whether they have the room before unpacking the message (which is CPU consuming). But there is no need to subscribe / unsubscribe every time a socket joins or leaves a room (which is also CPU consuming when there are thousands of subscriptions).
- Loading branch information
1 parent
d3d000b
commit 05f926e
Showing
5 changed files
with
58 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
language: node_js | ||
sudo: false | ||
node_js: | ||
- "0.10" | ||
- "0.12" | ||
- "4" | ||
- "6" | ||
- "node" | ||
|
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
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