Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Support wildcard subscriptions and drop array usage for sharding information
  • Loading branch information
Dougley committed Apr 9, 2017
1 parent a6b83b9 commit e3ead04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Bezerk.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function process (socket, message) {
if (msg.shard) {
Logger('Listener event defined a shard, trying to find it and send the message.')
for (let shard of shards) {
if (shard.shardInfo[0] === msg.shard) {
if (shard.shardInfo === msg.shard) {
Logger('Shard found, sending payload.')
shard.send(JSON.stringify(msg))
}
Expand All @@ -106,7 +106,7 @@ function process (socket, message) {
} else {
Logger('Request accepted, attempting to send data to subscribed listeners.')
for (let listener of receivers) {
if (listener.subscriptions.indexOf(msg.op) > -1 && listener.readyState === 1) {
if (listener.subscriptions.indexOf(msg.op) > -1 || listener.subscriptions.indexOf('*') > -1 && listener.readyState === 1) {
Logger('Sending data.')
listener.send(JSON.stringify(msg))
}
Expand Down

0 comments on commit e3ead04

Please sign in to comment.