akanjs 2.3.13-rc.2 → 2.3.13-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/signal/signalContext.ts
CHANGED
|
@@ -99,6 +99,11 @@ export class SignalContext<
|
|
|
99
99
|
}
|
|
100
100
|
return instance as T;
|
|
101
101
|
}
|
|
102
|
+
getService<T>(refName: string): T {
|
|
103
|
+
const service = this.#live.service.get(refName);
|
|
104
|
+
if (!service) throw new Exception.Error(`Service "${refName}" not found in live registry`);
|
|
105
|
+
return service as T;
|
|
106
|
+
}
|
|
102
107
|
async init() {
|
|
103
108
|
if (this.trace) {
|
|
104
109
|
const start = performance.now();
|
|
@@ -30,6 +30,7 @@ export declare class SignalContext<Ctx extends HttpExecutionContext | WebSocketE
|
|
|
30
30
|
middleware: Map<string, MiddlewareCls>;
|
|
31
31
|
});
|
|
32
32
|
getAdaptor<T extends Adaptor>(adaptorCls: AdaptorCls<T>): T;
|
|
33
|
+
getService<T>(refName: string): T;
|
|
33
34
|
init(): Promise<this>;
|
|
34
35
|
exec(): Promise<Response | undefined>;
|
|
35
36
|
static try(endpoint: Adaptor, endpointInfo: EndpointInfo, key: string, fn: () => Promise<Response | undefined>): Promise<Response | undefined>;
|