@appolo/bus
Advanced tools
Comparing version 8.0.6 to 8.0.7
@@ -45,3 +45,3 @@ "use strict"; | ||
try { | ||
let instance = this.injector.parent.get(handler.define.definition.id); | ||
let instance = this._getHandlerInjector(handler).get(handler.define.definition.id); | ||
await instance[handler.propertyKey](msg); | ||
@@ -59,5 +59,11 @@ if (!msg.isAcked) { | ||
} | ||
_getHandlerInjector(handler) { | ||
let def = handler.define.definition, injector = def.injector && def.injector.hasDefinition(def.id) | ||
? def.injector | ||
: this.injector.parent; | ||
return injector; | ||
} | ||
async _callReply(msg, handler) { | ||
try { | ||
let instance = this.injector.parent.get(handler.define.definition.id); | ||
let instance = this._getHandlerInjector(handler).get(handler.define.definition.id); | ||
let data = await instance[handler.propertyKey](msg); | ||
@@ -64,0 +70,0 @@ if (!msg.isAcked) { |
@@ -82,4 +82,5 @@ import {define, inject, Injector, singleton} from "@appolo/inject"; | ||
try { | ||
let instance = this.injector.parent.get(handler.define.definition.id); | ||
let instance = this._getHandlerInjector(handler).get(handler.define.definition.id); | ||
await instance[handler.propertyKey](msg); | ||
@@ -101,7 +102,17 @@ if (!msg.isAcked) { | ||
private _getHandlerInjector(handler: IHandler): Injector { | ||
let def = handler.define.definition, | ||
injector = def.injector && def.injector.hasDefinition(def.id) | ||
? def.injector | ||
: this.injector.parent; | ||
return injector; | ||
} | ||
private async _callReply(msg: Message<any>, handler: IHandler) { | ||
try { | ||
let instance = this.injector.parent.get(handler.define.definition.id); | ||
let instance = this._getHandlerInjector(handler).get(handler.define.definition.id); | ||
let data = await instance[handler.propertyKey](msg); | ||
@@ -108,0 +119,0 @@ |
{ | ||
"name": "@appolo/bus", | ||
"version": "8.0.6", | ||
"version": "8.0.7", | ||
"description": "appolo bus module", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81243
1816