Trying to fix - Bridge
This commit is contained in:
parent
d4628e183d
commit
75f3c58543
@ -264,7 +264,18 @@ export class Bridge implements ICommunicationInterface {
|
|||||||
): void {
|
): void {
|
||||||
const oldItems = this._combineLayers(layerToForwardTo, mode);
|
const oldItems = this._combineLayers(layerToForwardTo, mode);
|
||||||
// Store the Elements, that have been provided before.
|
// Store the Elements, that have been provided before.
|
||||||
this._dispatcherSubscribedTopicsMapping.set(dispatcherID, new Set(content));
|
switch (mode) {
|
||||||
|
case "events":
|
||||||
|
this._dispatcherSubscribedTopicsMapping.set(
|
||||||
|
dispatcherID,
|
||||||
|
new Set(content)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "services":
|
||||||
|
this._dispatcherServicesMapping.set(dispatcherID, new Set(content));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Store the Elements, that now have been provided.
|
// Store the Elements, that now have been provided.
|
||||||
const newItems = this._combineLayers(layerToForwardTo, mode);
|
const newItems = this._combineLayers(layerToForwardTo, mode);
|
||||||
|
|
||||||
@ -371,6 +382,15 @@ export class Bridge implements ICommunicationInterface {
|
|||||||
if (!this._callbacks.has(_name)) {
|
if (!this._callbacks.has(_name)) {
|
||||||
// Define the Callback and Store it.
|
// Define the Callback and Store it.
|
||||||
const callback = (msg) => {
|
const callback = (msg) => {
|
||||||
|
if (this._logger) {
|
||||||
|
this._logger.debug(
|
||||||
|
layerSubscribed.id,
|
||||||
|
"==",
|
||||||
|
_mapping[type],
|
||||||
|
"==>",
|
||||||
|
layerForwarded.id
|
||||||
|
);
|
||||||
|
}
|
||||||
layerForwarded[_mapping[type]](item, msg);
|
layerForwarded[_mapping[type]](item, msg);
|
||||||
};
|
};
|
||||||
this._callbacks.set(_name, {
|
this._callbacks.set(_name, {
|
||||||
@ -619,8 +639,8 @@ export class Bridge implements ICommunicationInterface {
|
|||||||
} else {
|
} else {
|
||||||
// Define a Function which stores the Actions:
|
// Define a Function which stores the Actions:
|
||||||
this[method as any] = async (...args) => {
|
this[method as any] = async (...args) => {
|
||||||
if (_this._logger) {
|
if (_this._logger && method !== "emitStatusUpdate") {
|
||||||
_this._logger.debug(method, ...args);
|
_this._logger.info(method, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const _layer of _this._connectedLayers.keys()) {
|
for (const _layer of _this._connectedLayers.keys()) {
|
||||||
@ -643,7 +663,7 @@ export class Bridge implements ICommunicationInterface {
|
|||||||
const _wrapped = (data) => {
|
const _wrapped = (data) => {
|
||||||
// Log the Forwarding
|
// Log the Forwarding
|
||||||
if (_this._logger && method != "onStatusUpdate") {
|
if (_this._logger && method != "onStatusUpdate") {
|
||||||
_this._logger.debug("Forwarding", method, "=>", METHOD_MAPPING[method]);
|
_this._logger.info("Forwarding", method, "=>", METHOD_MAPPING[method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const _layer of _this._connectedLayers.keys()) {
|
for (const _layer of _this._connectedLayers.keys()) {
|
||||||
@ -668,7 +688,7 @@ export class Bridge implements ICommunicationInterface {
|
|||||||
const _this = this;
|
const _this = this;
|
||||||
return (data) => {
|
return (data) => {
|
||||||
if (_this._logger && method != "onStatusUpdate") {
|
if (_this._logger && method != "onStatusUpdate") {
|
||||||
_this._logger.debug("Forwarding", method, "=>", METHOD_MAPPING[method]);
|
_this._logger.info("Forwarding", method, "=>", METHOD_MAPPING[method]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const _layer of _this._connectedLayers.keys()) {
|
for (const _layer of _this._connectedLayers.keys()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user