diff --git a/CHANGELOG.md b/CHANGELOG.md index d703051..a3c278a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000..a7bdd06 --- /dev/null +++ b/ROADMAP.md @@ -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. diff --git a/lib/cli/runNopeBackend.ts b/lib/cli/runNopeBackend.ts index c73b036..d3bd7ab 100644 --- a/lib/cli/runNopeBackend.ts +++ b/lib/cli/runNopeBackend.ts @@ -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); diff --git a/lib/dispatcher/nopeDispatcher.ts b/lib/dispatcher/nopeDispatcher.ts index de671e2..9d9a775 100644 --- a/lib/dispatcher/nopeDispatcher.ts +++ b/lib/dispatcher/nopeDispatcher.ts @@ -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 = 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 Promise>(); + this._definedFunctions = new Map(); } // Reset the Callbacks.