kevoree-group-centralizedws
Version:
WebSocket group based on a centralized architecture that only sends partial model to connected clients
13 lines (12 loc) • 382 B
JavaScript
module.exports = function findMasterNode(group) {
if (group) {
for (let i = 0; i < group.fragmentDictionary.array.length; i++) {
const fDic = group.fragmentDictionary.array[i];
const isMaster = fDic.findValuesByID('isMaster');
if (isMaster && isMaster.value === 'true') {
return group.findSubNodesByID(fDic.name);
}
}
}
return null;
};