Basic fixes

This commit is contained in:
Martin Karkowski 2021-08-26 19:40:46 +02:00
parent 9a9f235e8b
commit d0d1b38d8c
4 changed files with 22 additions and 10 deletions

View File

@ -1,7 +1,6 @@
# 0.9.8
# 0.9.7.1
- Adding the functionality to expose the running tasks of a dispatcher. Therefore the Layers use a different event ``.
- The user can specify if he wants to defaultly force emitting services or not.
- If the Channel "event" is selected the "force-emitting" is enabled
# 0.9.7

6
ROADMAP.md Normal file
View File

@ -0,0 +1,6 @@
# 0.9.9 Depencies
# 0.9.8
- Adding the functionality to expose the running tasks of a dispatcher. Therefore the Layers use a different event ``.
- The user can specify if he wants to defaultly force emitting services or not.

View File

@ -222,9 +222,9 @@ export async function runNopeBackend(
let loader: INopePackageLoader;
try {
loader = getPackageLoader({
communicator: getLayer(args.channel, opts.params, "debug"),
logger: getNopeLogger("dispatcher", "debug"),
forceEmittingUpdates: args.forceEmittingUpdates,
communicator: getLayer(args.channel, opts.params, "info"),
logger: getNopeLogger("dispatcher", "info"),
forceEmittingUpdates: args.forceEmittingUpdates || args.channel == "event",
}, _args.singleton);
} catch (e) {
getNopeLogger("cli", "info").error("failed to load the Packages", e);

View File

@ -598,7 +598,7 @@ export class nopeDispatcher implements INopeDispatcher {
identifier: func["id"]
});
} else {
throw Error("Function not registered at dispatcher.");
throw Error("Wrong type provided");
}
}
@ -2758,6 +2758,13 @@ export class nopeDispatcher implements INopeDispatcher {
? observable
: (observable.id as string) || "0";
let _observable: INopeObservable<any> = null;
for (const obs of this._registeredObservables.keys()) {
if (obs.id == _id) {
_observable = obs;
}
}
if (!options.preventSendingToRegistery) {
// Publish the Available Services.
this._sendAvailableObservables();
@ -2770,7 +2777,7 @@ export class nopeDispatcher implements INopeDispatcher {
}
}
return this._definedFunctions.delete(_id);
return this._registeredObservables.delete(_observable);
}
protected _externalTopicLinkedWithObservable: Map<
@ -2803,7 +2810,7 @@ export class nopeDispatcher implements INopeDispatcher {
if (item) {
this.communicator.offEvent(path, item.cb);
// Dispose the Observable
const obs = this._externalTopicLinkedWithObservable.get(path).observable;
const obs = item.observable;
obs.dispose();
// Remove the Observable
this._externalTopicLinkedWithObservable.delete(path);
@ -3298,7 +3305,7 @@ export class nopeDispatcher implements INopeDispatcher {
}
this._definedFunctions.clear();
} else {
this._definedFunctions = new Map<string, (...args) => Promise<any>>();
this._definedFunctions = new Map();
}
// Reset the Callbacks.