@aom-js/transfer 0.0.3 → 0.0.4
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/dist/cjs/defines/decorators.d.ts +2 -0
- package/dist/cjs/defines/decorators.d.ts.map +1 -1
- package/dist/cjs/defines/decorators.js +30 -122
- package/dist/cjs/defines/decorators.js.map +1 -1
- package/dist/cjs/defines/index.d.ts +1 -0
- package/dist/cjs/defines/index.d.ts.map +1 -1
- package/dist/cjs/defines/index.js +1 -0
- package/dist/cjs/defines/index.js.map +1 -1
- package/dist/cjs/defines/main.d.ts +18 -3
- package/dist/cjs/defines/main.d.ts.map +1 -1
- package/dist/cjs/defines/main.js +40 -35
- package/dist/cjs/defines/main.js.map +1 -1
- package/dist/cjs/defines/registry.d.ts +11 -0
- package/dist/cjs/defines/registry.d.ts.map +1 -0
- package/dist/cjs/defines/registry.js +34 -0
- package/dist/cjs/defines/registry.js.map +1 -0
- package/dist/cjs/defines/rx-transfer.d.ts +11 -0
- package/dist/cjs/defines/rx-transfer.d.ts.map +1 -0
- package/dist/cjs/defines/rx-transfer.js +162 -0
- package/dist/cjs/defines/rx-transfer.js.map +1 -0
- package/dist/cjs/defines/types.d.ts +25 -4
- package/dist/cjs/defines/types.d.ts.map +1 -1
- package/dist/mjs/defines/decorators.js +28 -86
- package/dist/mjs/defines/decorators.js.map +1 -1
- package/dist/mjs/defines/index.js +1 -0
- package/dist/mjs/defines/index.js.map +1 -1
- package/dist/mjs/defines/main.js +40 -35
- package/dist/mjs/defines/main.js.map +1 -1
- package/dist/mjs/defines/registry.js +28 -0
- package/dist/mjs/defines/registry.js.map +1 -0
- package/dist/mjs/defines/rx-transfer.js +122 -0
- package/dist/mjs/defines/rx-transfer.js.map +1 -0
- package/dist/types/defines/decorators.d.ts +2 -0
- package/dist/types/defines/index.d.ts +1 -0
- package/dist/types/defines/main.d.ts +18 -3
- package/dist/types/defines/registry.d.ts +10 -0
- package/dist/types/defines/rx-transfer.d.ts +10 -0
- package/dist/types/defines/types.d.ts +25 -4
- package/package.json +2 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Transfer } from "./main";
|
|
2
2
|
export declare function Isolator(transfer: Transfer): ClassDecorator;
|
|
3
|
+
export declare function IsQueue(): MethodDecorator;
|
|
4
|
+
export declare function IsDistributed(): ClassDecorator;
|
|
3
5
|
export declare function CustomTopic(singletone?: boolean): MethodDecorator;
|
|
4
6
|
export declare function ResponseTopic(singletone?: boolean): MethodDecorator;
|
|
5
7
|
export declare function Executor(instanceId?: string): ClassDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/defines/decorators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/defines/decorators.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAe,MAAM,QAAQ,CAAC;AAQ/C,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,CAS3D;AAGD,wBAAgB,OAAO,oBAItB;AAGD,wBAAgB,aAAa,mBAK5B;AAOD,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,eAAe,CAEjE;AAOD,wBAAgB,aAAa,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,eAAe,CAEnE;AAwED,wBAAgB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,cAAc,CAkB5D"}
|
|
@@ -1,56 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.Isolator = Isolator;
|
|
4
|
+
exports.IsQueue = IsQueue;
|
|
5
|
+
exports.IsDistributed = IsDistributed;
|
|
40
6
|
exports.CustomTopic = CustomTopic;
|
|
41
7
|
exports.ResponseTopic = ResponseTopic;
|
|
42
8
|
exports.Executor = Executor;
|
|
43
9
|
const core_1 = require("@aom-js/core");
|
|
44
|
-
const rxjs = __importStar(require("rxjs"));
|
|
45
|
-
const rxjsOperators = __importStar(require("rxjs/operators"));
|
|
46
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
47
10
|
const main_1 = require("./main");
|
|
11
|
+
const rx_transfer_1 = require("./rx-transfer");
|
|
48
12
|
function Isolator(transfer) {
|
|
49
13
|
return main_1.AomIsolator.classDecorator(($) => {
|
|
50
14
|
$.transfer = transfer;
|
|
15
|
+
$.rx = new rx_transfer_1.RxTransfer(transfer);
|
|
51
16
|
$._.apply();
|
|
52
17
|
});
|
|
53
18
|
}
|
|
19
|
+
function IsQueue() {
|
|
20
|
+
return main_1.AomIsolator.methodDecorator(($) => {
|
|
21
|
+
$.queue = true;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function IsDistributed() {
|
|
25
|
+
return main_1.AomIsolator.classDecorator(($) => {
|
|
26
|
+
$.transfer.registryMap.set($._.target, $._.target.name);
|
|
27
|
+
}, core_1.DecoratorsQueueStore.LAST);
|
|
28
|
+
}
|
|
54
29
|
function CustomTopic(singletone) {
|
|
55
30
|
return AutoTopic(false, singletone);
|
|
56
31
|
}
|
|
@@ -58,8 +33,8 @@ function ResponseTopic(singletone) {
|
|
|
58
33
|
return AutoTopic(true, singletone);
|
|
59
34
|
}
|
|
60
35
|
function DefineTopics() {
|
|
61
|
-
return main_1.AomIsolator.methodDecorator(($,
|
|
62
|
-
const { topicsMap } = $._.root;
|
|
36
|
+
return main_1.AomIsolator.methodDecorator(($, _descriptor) => {
|
|
37
|
+
const { topicsMap, instancesMap } = $._.root;
|
|
63
38
|
const constructor = $._.target;
|
|
64
39
|
const propertyKey = $._.property;
|
|
65
40
|
$._.root.isolatedMethods.push($);
|
|
@@ -72,6 +47,7 @@ function DefineTopics() {
|
|
|
72
47
|
const replyTopic = `reply_${topic}_${transfer.instanceKey}_${transfer.instanceName}`;
|
|
73
48
|
topics = { topic, replyTopic };
|
|
74
49
|
topicsMap.set(constructor[propertyKey], topics);
|
|
50
|
+
instancesMap.set(constructor[propertyKey], $);
|
|
75
51
|
}
|
|
76
52
|
return topics;
|
|
77
53
|
};
|
|
@@ -85,66 +61,13 @@ function AutoTopic(waitForResponse, singletone) {
|
|
|
85
61
|
return main_1.AomIsolator.methodDecorator(($, descriptor) => {
|
|
86
62
|
const constructor = $._.target;
|
|
87
63
|
const propertyKey = $._.property;
|
|
64
|
+
$.singletone = singletone;
|
|
65
|
+
$.waitForResponse = waitForResponse;
|
|
66
|
+
$.originDescriptorValue = descriptor.value;
|
|
88
67
|
Reflect.decorate([DefineTopics()], constructor, propertyKey);
|
|
89
|
-
const { value: originValue } = descriptor;
|
|
90
|
-
const topicProcessMap = new Map();
|
|
91
|
-
const replySubscribers = {};
|
|
92
|
-
const initReplySubscription = (topics, transfer) => {
|
|
93
|
-
const { topic, replyTopic } = topics;
|
|
94
|
-
if (!replySubscribers[replyTopic]) {
|
|
95
|
-
transfer.subscriber(replyTopic, transfer.replyHandler(topic));
|
|
96
|
-
replySubscribers[replyTopic] = true;
|
|
97
|
-
}
|
|
98
|
-
return replySubscribers[replyTopic];
|
|
99
|
-
};
|
|
100
68
|
descriptor.value = async (...args) => {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const { transfer } = $._.root;
|
|
104
|
-
const uniqKey = node_crypto_1.default.randomUUID();
|
|
105
|
-
const hash = node_crypto_1.default.createHash("sha256").update(JSON.stringify(value)).digest("hex");
|
|
106
|
-
const topicProcessKey = `${topic}_${hash}_${singletone ? "singletone" : uniqKey}`;
|
|
107
|
-
const headers = {
|
|
108
|
-
replyTopic,
|
|
109
|
-
uniqKey,
|
|
110
|
-
};
|
|
111
|
-
const existsProcess = topicProcessMap.get(topicProcessKey);
|
|
112
|
-
if (existsProcess) {
|
|
113
|
-
return existsProcess;
|
|
114
|
-
}
|
|
115
|
-
const instanceTopic = $._.root.instanceTopic(topic);
|
|
116
|
-
const rx$ = rxjs
|
|
117
|
-
.defer(async () => initReplySubscription({ topic, replyTopic }, transfer))
|
|
118
|
-
.pipe(rxjsOperators.mergeMap(() => new rxjs.Observable((observer) => {
|
|
119
|
-
const callback = callbackObserver(observer);
|
|
120
|
-
transfer.callbackMap.set(uniqKey, callback);
|
|
121
|
-
transfer.publisher(instanceTopic, { headers, value });
|
|
122
|
-
return () => {
|
|
123
|
-
transfer.callbackMap.delete(uniqKey);
|
|
124
|
-
};
|
|
125
|
-
})));
|
|
126
|
-
let result;
|
|
127
|
-
if (waitForResponse) {
|
|
128
|
-
result = rxjs
|
|
129
|
-
.firstValueFrom(rx$)
|
|
130
|
-
.then((result) => {
|
|
131
|
-
topicProcessMap.delete(topicProcessKey);
|
|
132
|
-
return result;
|
|
133
|
-
})
|
|
134
|
-
.catch((err) => {
|
|
135
|
-
topicProcessMap.delete(topicProcessKey);
|
|
136
|
-
throw err;
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
result = rx$.subscribe();
|
|
141
|
-
result.add(() => {
|
|
142
|
-
topicProcessMap.delete(topicProcessKey);
|
|
143
|
-
Reflect.apply(originValue, constructor, []);
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
topicProcessMap.set(topicProcessKey, result);
|
|
147
|
-
return result;
|
|
69
|
+
const { rx } = $._.root;
|
|
70
|
+
return rx.request(args, $);
|
|
148
71
|
};
|
|
149
72
|
}, core_1.DecoratorsQueueStore.FIRST);
|
|
150
73
|
}
|
|
@@ -167,35 +90,20 @@ function Executor(instanceId) {
|
|
|
167
90
|
}
|
|
168
91
|
function attachIsolation(constructor, propertyKey, instanceId) {
|
|
169
92
|
const parentConstructor = Object.getPrototypeOf(constructor);
|
|
170
|
-
const parent$ = main_1.AomIsolator.instance(
|
|
93
|
+
const parent$ = main_1.AomIsolator.instance(parentConstructor);
|
|
171
94
|
const { name } = constructor;
|
|
172
|
-
const { transfer
|
|
95
|
+
const { transfer, rx, topicsMap, instancesMap } = parent$;
|
|
173
96
|
const isolatedTopics = topicsMap.get(parentConstructor[propertyKey]);
|
|
97
|
+
const parentProperty$ = instancesMap.get(parentConstructor[propertyKey]);
|
|
174
98
|
if (!isolatedTopics) {
|
|
175
99
|
throw new Error(`attached handler is not isolated topic ${name}.${String(propertyKey)}`);
|
|
176
100
|
}
|
|
177
101
|
const { topic } = isolatedTopics;
|
|
178
102
|
const instanceTopic = main_1.Transfer.instanceTopic(topic, instanceId);
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
};
|
|
185
|
-
const serializeResponse = (response, topic) => {
|
|
186
|
-
return response;
|
|
187
|
-
};
|
|
188
|
-
return (result) => {
|
|
189
|
-
const { error, value, topic, isCompleted } = result;
|
|
190
|
-
if (error) {
|
|
191
|
-
return observer.error(serializeError(error, topic));
|
|
192
|
-
}
|
|
193
|
-
else if (isCompleted) {
|
|
194
|
-
observer.next(serializeResponse(value, topic));
|
|
195
|
-
return observer.complete();
|
|
196
|
-
}
|
|
197
|
-
observer.next(serializeResponse(value, topic));
|
|
198
|
-
return null;
|
|
199
|
-
};
|
|
103
|
+
transfer.subscriber({
|
|
104
|
+
topic: instanceTopic,
|
|
105
|
+
next: rx.execHandler((...args) => Reflect.apply(constructor[propertyKey], constructor, args)),
|
|
106
|
+
queue: parentProperty$.queue,
|
|
107
|
+
});
|
|
200
108
|
}
|
|
201
109
|
//# sourceMappingURL=decorators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/defines/decorators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/defines/decorators.ts"],"names":[],"mappings":";;AAWA,4BASC;AAGD,0BAIC;AAGD,sCAKC;AAOD,kCAEC;AAOD,sCAEC;AAwED,4BAkBC;AA/ID,uCAA2E;AAG3E,iCAA+C;AAC/C,+CAA2C;AAO3C,SAAgB,QAAQ,CAAC,QAAkB;IAEzC,OAAO,kBAAW,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE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ot":"","sources":["../../../src/defines/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/defines/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./decorators"), exports);
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
__exportStar(require("./main"), exports);
|
|
20
|
+
__exportStar(require("./registry"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/defines/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB;AACxB,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/defines/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB;AACxB,yCAAuB;AACvB,6CAA2B"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { AomCore, Constructor, ClassConstructor } from "@aom-js/core";
|
|
2
|
-
import { TransferConfig, TransferPublishHandler, TransferSubscribeHandler, TransferCallbackHandler,
|
|
2
|
+
import { TransferConfig, TransferPublishHandler, TransferSubscribeHandler, TransferCallbackHandler, TransferTopics, StructureCollectorFunction } from "./types";
|
|
3
|
+
import { RxTransfer } from "./rx-transfer";
|
|
3
4
|
export declare class AomIsolator extends AomCore {
|
|
4
5
|
transfer: Transfer;
|
|
6
|
+
rx: RxTransfer;
|
|
7
|
+
singletone: boolean;
|
|
8
|
+
waitForResponse: boolean;
|
|
9
|
+
originDescriptorValue: Function;
|
|
10
|
+
queue: boolean;
|
|
11
|
+
registry: boolean;
|
|
12
|
+
replySubscribers: Record<string, boolean>;
|
|
13
|
+
topicProcessMap: Map<string, any>;
|
|
5
14
|
isolatedMethods: AomIsolator[];
|
|
6
15
|
topicsMap: WeakMap<Constructor, TransferTopics>;
|
|
16
|
+
instancesMap: WeakMap<Constructor, AomIsolator>;
|
|
7
17
|
instanceId?: string;
|
|
8
18
|
topic: string;
|
|
9
19
|
replyTopic: string;
|
|
@@ -14,11 +24,16 @@ export declare class Transfer implements TransferConfig {
|
|
|
14
24
|
instanceKey: string;
|
|
15
25
|
publisher: TransferPublishHandler;
|
|
16
26
|
subscriber: TransferSubscribeHandler;
|
|
27
|
+
private structureCollector?;
|
|
17
28
|
callbackMap: Map<string, TransferCallbackHandler>;
|
|
29
|
+
readonly registryRequestTopic = "!Transfer_Registry_Request!";
|
|
30
|
+
readonly registryResponseTopic = "!Transfer_Registry_Notification!";
|
|
31
|
+
readonly registryMap: Map<ClassConstructor, any>;
|
|
18
32
|
constructor(config: TransferConfig);
|
|
19
33
|
static toInstance<T extends ClassConstructor<any>>(constructor: T, instanceId: string): T;
|
|
20
34
|
static instanceTopic(topic: string, instanceId?: string): string;
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
collectDistributions(colllectCallbackHandler: StructureCollectorFunction): void;
|
|
36
|
+
private requestRegistry;
|
|
37
|
+
private acceptRegistry;
|
|
23
38
|
}
|
|
24
39
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/defines/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/defines/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WA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C;IAEpE,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAa;gBAMjD,MAAM,EAAE,cAAc;IA6BlC,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,gBAAgB,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;IAWzF,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;IAMhE,oBAAoB,CAAC,uBAAuB,EAAE,0BAA0B;IAgBxE,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,cAAc;CAevB"}
|
package/dist/cjs/defines/main.js
CHANGED
|
@@ -5,8 +5,11 @@ const core_1 = require("@aom-js/core");
|
|
|
5
5
|
class AomIsolator extends core_1.AomCore {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
+
this.replySubscribers = {};
|
|
9
|
+
this.topicProcessMap = new Map();
|
|
8
10
|
this.isolatedMethods = [];
|
|
9
11
|
this.topicsMap = new WeakMap();
|
|
12
|
+
this.instancesMap = new WeakMap();
|
|
10
13
|
}
|
|
11
14
|
instanceTopic(topic) {
|
|
12
15
|
const result = Transfer.instanceTopic(topic, this.instanceId);
|
|
@@ -17,11 +20,22 @@ class AomIsolator extends core_1.AomCore {
|
|
|
17
20
|
exports.AomIsolator = AomIsolator;
|
|
18
21
|
class Transfer {
|
|
19
22
|
constructor(config) {
|
|
23
|
+
this.registryRequestTopic = `!Transfer_Registry_Request!`;
|
|
24
|
+
this.registryResponseTopic = `!Transfer_Registry_Notification!`;
|
|
25
|
+
this.registryMap = new Map();
|
|
20
26
|
this.publisher = config.publisher;
|
|
21
27
|
this.subscriber = config.subscriber;
|
|
22
28
|
this.instanceKey = config.instanceKey;
|
|
23
29
|
this.instanceName = config.instanceName;
|
|
24
30
|
this.callbackMap = new Map();
|
|
31
|
+
this.subscriber({
|
|
32
|
+
topic: this.registryRequestTopic,
|
|
33
|
+
next: (message) => this.requestRegistry(message.value),
|
|
34
|
+
});
|
|
35
|
+
this.subscriber({
|
|
36
|
+
topic: this.registryResponseTopic,
|
|
37
|
+
next: (message) => this.acceptRegistry(message.value),
|
|
38
|
+
});
|
|
25
39
|
}
|
|
26
40
|
static toInstance(constructor, instanceId) {
|
|
27
41
|
AomIsolator.instance(constructor).instanceId = instanceId;
|
|
@@ -30,42 +44,33 @@ class Transfer {
|
|
|
30
44
|
static instanceTopic(topic, instanceId) {
|
|
31
45
|
return [topic, instanceId].filter(Boolean).join("_");
|
|
32
46
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
callback({ topic, value });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
+
collectDistributions(colllectCallbackHandler) {
|
|
48
|
+
this.structureCollector = colllectCallbackHandler;
|
|
49
|
+
const { instanceName, instanceKey } = this;
|
|
50
|
+
const value = { instanceName, instanceKey };
|
|
51
|
+
this.publisher({
|
|
52
|
+
topic: this.registryRequestTopic,
|
|
53
|
+
message: { value, headers: {} },
|
|
54
|
+
});
|
|
47
55
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
};
|
|
56
|
+
requestRegistry(sender) {
|
|
57
|
+
const { instanceName, instanceKey } = this;
|
|
58
|
+
if (!(sender.instanceName === instanceName && sender.instanceKey === instanceKey)) {
|
|
59
|
+
const schemas = this.registryMap.entries();
|
|
60
|
+
const value = { receiver: sender, sender: { instanceName, instanceKey }, schemas };
|
|
61
|
+
this.publisher({ topic: this.registryResponseTopic, message: { value, headers: {} } });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
acceptRegistry(registry) {
|
|
65
|
+
const { receiver } = registry;
|
|
66
|
+
const { instanceName, instanceKey } = this;
|
|
67
|
+
if (this.structureCollector &&
|
|
68
|
+
receiver.instanceName === instanceName &&
|
|
69
|
+
receiver.instanceKey === instanceKey) {
|
|
70
|
+
const { schemas, sender } = registry;
|
|
71
|
+
const structureData = { instance: sender, value: schemas };
|
|
72
|
+
Reflect.apply(this.structureCollector, null, [structureData]);
|
|
73
|
+
}
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
exports.Transfer = Transfer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/defines/main.ts"],"names":[],"mappings":";;;AAAA,uCAAsE;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/defines/main.ts"],"names":[],"mappings":";;;AAAA,uCAAsE;AAuBtE,MAAa,WAAY,SAAQ,cAAO;IAAxC;;QAeE,qBAAgB,GAA4B,EAAE,CAAC;QAE/C,oBAAe,GAAqB,IAAI,GAAG,EAAE,CAAC;QAE9C,oBAAe,GAAkB,EAAE,CAAC;QAEpC,cAAS,GAAyC,IAAI,OAAO,EAAE,CAAC;QAEhE,iBAAY,GAAsC,IAAI,OAAO,EAAE,CAAC;IAalE,CAAC;IALC,aAAa,CAAC,KAAa;QACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AApCD,kCAoCC;AAMD,MAAa,QAAQ;IA4BnB,YAAY,MAAsB;QATzB,yBAAoB,GAAG,6BAA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a,CAAC,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF;AAvHD,4BAuHC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Transfer } from "./main";
|
|
2
|
+
export declare class TransferRegistry {
|
|
3
|
+
static Init(transfer: Transfer): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare class TransferRegistryIsolator {
|
|
6
|
+
static Request(value: string): void;
|
|
7
|
+
}
|
|
8
|
+
export declare class TransferRegistryExecutor extends TransferRegistryIsolator {
|
|
9
|
+
static Request(value: string): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/defines/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,qBAAa,gBAAgB;WACd,IAAI,CAAC,QAAQ,EAAE,QAAQ;CACrC;AAED,qBAAa,wBAAwB;IAEnC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM;CAC7B;AAED,qBAAa,wBAAyB,SAAQ,wBAAwB;IACpE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM;CAI7B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TransferRegistryExecutor = exports.TransferRegistryIsolator = exports.TransferRegistry = void 0;
|
|
13
|
+
const decorators_1 = require("./decorators");
|
|
14
|
+
class TransferRegistry {
|
|
15
|
+
static async Init(transfer) { }
|
|
16
|
+
}
|
|
17
|
+
exports.TransferRegistry = TransferRegistry;
|
|
18
|
+
class TransferRegistryIsolator {
|
|
19
|
+
static Request(value) { }
|
|
20
|
+
}
|
|
21
|
+
exports.TransferRegistryIsolator = TransferRegistryIsolator;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, decorators_1.ResponseTopic)(),
|
|
24
|
+
__metadata("design:type", Function),
|
|
25
|
+
__metadata("design:paramtypes", [String]),
|
|
26
|
+
__metadata("design:returntype", void 0)
|
|
27
|
+
], TransferRegistryIsolator, "Request", null);
|
|
28
|
+
class TransferRegistryExecutor extends TransferRegistryIsolator {
|
|
29
|
+
static Request(value) {
|
|
30
|
+
console.log("TransferRegistryExecutor.Request received", { value });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.TransferRegistryExecutor = TransferRegistryExecutor;
|
|
34
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/defines/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAuD;AAGvD,MAAa,gBAAgB;IAC3B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAkB,IAAG,CAAC;CACzC;AAFD,4CAEC;AAED,MAAa,wBAAwB;IAE5B,AAAP,MAAM,CAAC,OAAO,CAAC,KAAa,IAAG,CAAC;CACjC;AAHD,4DAGC;AADQ;IADN,IAAA,0BAAa,GAAE;;;;6CACgB;AAGlC,MAAa,wBAAyB,SAAQ,wBAAwB;IACpE,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,CAAC,GAAG,CAAC,2CAA2C,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAEtE,CAAC;CACF;AALD,4DAKC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AomIsolator, Transfer } from "./main";
|
|
2
|
+
import { TransferNextFunction } from "./types";
|
|
3
|
+
export declare class RxTransfer {
|
|
4
|
+
private transfer;
|
|
5
|
+
constructor(transfer: Transfer);
|
|
6
|
+
initReplySubscription($: AomIsolator): boolean;
|
|
7
|
+
request(value: any[], $: AomIsolator): any;
|
|
8
|
+
replyHandler(topic: string): TransferNextFunction;
|
|
9
|
+
execHandler(handler: Function): TransferNextFunction;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=rx-transfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rx-transfer.d.ts","sourceRoot":"","sources":["../../../src/defines/rx-transfer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAIL,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAW;gBAEf,QAAQ,EAAE,QAAQ;IAS9B,qBAAqB,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;IAS9C,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,WAAW;IAqFpC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB;IA4BjD,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,oBAAoB;CA4BrD"}
|