Skip to content

Commit

Permalink
Fix camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
jondubois committed Mar 10, 2022
1 parent a0586aa commit 54d06de
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions cluster-broker-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ ClusterBrokerClient.prototype.setBrokers = function (sccBrokerURIList) {
})();
});

let unusedsccBrokerURIList = Object.keys(this.sccBrokerClientPools).filter((clientURI) => {
let unusedSCCBrokerURIList = Object.keys(this.sccBrokerClientPools).filter((clientURI) => {
return !brokerClientMap[clientURI];
});
unusedsccBrokerURIList.forEach((clientURI) => {
unusedSCCBrokerURIList.forEach((clientURI) => {
let unusedClientPool = this.sccBrokerClientPools[clientURI];
unusedClientPool.destroy();
delete this.sccBrokerClientPools[clientURI];
});

let newSubscriptionsMap = {};
fullSubscriptionList.forEach((channelName) => {
let targetsccBrokerURI = this.mapChannelNameToBrokerURI(channelName);
if (!newSubscriptionsMap[targetsccBrokerURI]) {
newSubscriptionsMap[targetsccBrokerURI] = {};
let targetSCCBrokerURI = this.mapChannelNameToBrokerURI(channelName);
if (!newSubscriptionsMap[targetSCCBrokerURI]) {
newSubscriptionsMap[targetSCCBrokerURI] = {};
}
if (!newSubscriptionsMap[targetsccBrokerURI][channelName]) {
newSubscriptionsMap[targetsccBrokerURI][channelName] = true;
if (!newSubscriptionsMap[targetSCCBrokerURI][channelName]) {
newSubscriptionsMap[targetSCCBrokerURI][channelName] = true;
}
});

Expand Down Expand Up @@ -180,33 +180,33 @@ ClusterBrokerClient.prototype._subscribeClientPoolToChannelAndWatch = function (
};

ClusterBrokerClient.prototype.subscribe = function (channelName) {
let targetsccBrokerURI = this.mapChannelNameToBrokerURI(channelName);
let targetsccBrokerClientPool = this.sccBrokerClientPools[targetsccBrokerURI];
if (targetsccBrokerClientPool) {
this._subscribeClientPoolToChannelAndWatch(targetsccBrokerClientPool, channelName);
let targetSCCBrokerURI = this.mapChannelNameToBrokerURI(channelName);
let targetSCCBrokerClientPool = this.sccBrokerClientPools[targetSCCBrokerURI];
if (targetSCCBrokerClientPool) {
this._subscribeClientPoolToChannelAndWatch(targetSCCBrokerClientPool, channelName);
} else {
let error = this.errors.NoMatchingSubscribeTargetError(channelName);
this.emit('error', {error});
}
};

ClusterBrokerClient.prototype.unsubscribe = function (channelName) {
let targetsccBrokerURI = this.mapChannelNameToBrokerURI(channelName);
let targetsccBrokerClientPool = this.sccBrokerClientPools[targetsccBrokerURI];
if (targetsccBrokerClientPool) {
targetsccBrokerClientPool.unsubscribe(channelName);
targetsccBrokerClientPool.closeChannel(channelName);
let targetSCCBrokerURI = this.mapChannelNameToBrokerURI(channelName);
let targetSCCBrokerClientPool = this.sccBrokerClientPools[targetSCCBrokerURI];
if (targetSCCBrokerClientPool) {
targetSCCBrokerClientPool.unsubscribe(channelName);
targetSCCBrokerClientPool.closeChannel(channelName);
} else {
let error = this.errors.NoMatchingUnsubscribeTargetError(channelName);
this.emit('error', {error});
}
};

ClusterBrokerClient.prototype.invokePublish = function (channelName, data) {
let targetsccBrokerURI = this.mapChannelNameToBrokerURI(channelName);
let targetsccBrokerClientPool = this.sccBrokerClientPools[targetsccBrokerURI];
if (targetsccBrokerClientPool) {
targetsccBrokerClientPool.invokePublish(channelName, data);
let targetSCCBrokerURI = this.mapChannelNameToBrokerURI(channelName);
let targetSCCBrokerClientPool = this.sccBrokerClientPools[targetSCCBrokerURI];
if (targetSCCBrokerClientPool) {
targetSCCBrokerClientPool.invokePublish(channelName, data);
} else {
let error = this.errors.NoMatchingPublishTargetError(channelName);
this.emit('error', {error});
Expand Down

0 comments on commit 54d06de

Please sign in to comment.