cry-ebus2 3.0.7 → 3.1.0
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/EbusClientEvents.js +1 -2
- package/dist/EbusConfiguration.js +1 -2
- package/dist/EbusReject.d.ts +1 -1
- package/dist/EbusReject.d.ts.map +1 -1
- package/dist/EbusReject.js +4 -5
- package/dist/EbusReject.js.map +1 -1
- package/dist/EbusRejectReason.js +1 -2
- package/dist/EbusRequestOptions.js +1 -2
- package/dist/EbusUnpackedResult.d.ts +2 -2
- package/dist/EbusUnpackedResult.d.ts.map +1 -1
- package/dist/EbusUnpackedResult.js +12 -12
- package/dist/EbusUnpackedResult.js.map +1 -1
- package/dist/block.js +1 -5
- package/dist/block.js.map +1 -1
- package/dist/broker.d.ts +4 -3
- package/dist/broker.d.ts.map +1 -1
- package/dist/broker.js +54 -59
- package/dist/broker.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -5
- package/dist/client.js.map +1 -1
- package/dist/clientBlocking.d.ts +6 -6
- package/dist/clientBlocking.d.ts.map +1 -1
- package/dist/clientBlocking.js +47 -47
- package/dist/clientBlocking.js.map +1 -1
- package/dist/clientNonBlocking.d.ts +6 -6
- package/dist/clientNonBlocking.d.ts.map +1 -1
- package/dist/clientNonBlocking.js +64 -65
- package/dist/clientNonBlocking.js.map +1 -1
- package/dist/consts.d.ts +1 -1
- package/dist/consts.d.ts.map +1 -1
- package/dist/consts.js +1 -4
- package/dist/consts.js.map +1 -1
- package/dist/delayWorker.d.ts +1 -1
- package/dist/delayWorker.d.ts.map +1 -1
- package/dist/delayWorker.js +7 -14
- package/dist/delayWorker.js.map +1 -1
- package/dist/echoWorker.d.ts +1 -1
- package/dist/echoWorker.d.ts.map +1 -1
- package/dist/echoWorker.js +5 -12
- package/dist/echoWorker.js.map +1 -1
- package/dist/errorWorker.d.ts +1 -1
- package/dist/errorWorker.d.ts.map +1 -1
- package/dist/errorWorker.js +7 -14
- package/dist/errorWorker.js.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -29
- package/dist/index.js.map +1 -1
- package/dist/loadConfiguration.d.ts +1 -1
- package/dist/loadConfiguration.d.ts.map +1 -1
- package/dist/loadConfiguration.js +4 -8
- package/dist/loadConfiguration.js.map +1 -1
- package/dist/pub.d.ts +1 -1
- package/dist/pub.d.ts.map +1 -1
- package/dist/pub.js +12 -13
- package/dist/pub.js.map +1 -1
- package/dist/rejectWorker.d.ts +1 -1
- package/dist/rejectWorker.d.ts.map +1 -1
- package/dist/rejectWorker.js +7 -14
- package/dist/rejectWorker.js.map +1 -1
- package/dist/run/all.js +12 -14
- package/dist/run/all.js.map +1 -1
- package/dist/run/broker.js +4 -6
- package/dist/run/broker.js.map +1 -1
- package/dist/run/call.js +27 -24
- package/dist/run/call.js.map +1 -1
- package/dist/run/calling.js +8 -11
- package/dist/run/calling.js.map +1 -1
- package/dist/run/callingBurst.js +8 -11
- package/dist/run/callingBurst.js.map +1 -1
- package/dist/run/delay.js +4 -6
- package/dist/run/delay.js.map +1 -1
- package/dist/run/echo.js +4 -6
- package/dist/run/echo.js.map +1 -1
- package/dist/run/error.js +4 -6
- package/dist/run/error.js.map +1 -1
- package/dist/run/ping.js +24 -26
- package/dist/run/ping.js.map +1 -1
- package/dist/run/pub.js +7 -9
- package/dist/run/pub.js.map +1 -1
- package/dist/run/reject.js +4 -6
- package/dist/run/reject.js.map +1 -1
- package/dist/run/sub.js +31 -35
- package/dist/run/sub.js.map +1 -1
- package/dist/run/termimalCommands.js +1 -3
- package/dist/run/termimalCommands.js.map +1 -1
- package/dist/run/workers.js +13 -19
- package/dist/run/workers.js.map +1 -1
- package/dist/serialize.d.ts +1 -1
- package/dist/serialize.d.ts.map +1 -1
- package/dist/serialize.js +12 -20
- package/dist/serialize.js.map +1 -1
- package/dist/service.d.ts +1 -1
- package/dist/service.js +17 -17
- package/dist/service.js.map +1 -1
- package/dist/sleep.js +1 -5
- package/dist/sleep.js.map +1 -1
- package/dist/sub.d.ts +2 -2
- package/dist/sub.d.ts.map +1 -1
- package/dist/sub.js +16 -15
- package/dist/sub.js.map +1 -1
- package/dist/test/config.js +10 -12
- package/dist/test/config.js.map +1 -1
- package/dist/test/echo.js +19 -21
- package/dist/test/echo.js.map +1 -1
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/pack.js +33 -35
- package/dist/test/pack.js.map +1 -1
- package/dist/test/performance.js +7 -9
- package/dist/test/performance.js.map +1 -1
- package/dist/test/pub.js +14 -16
- package/dist/test/pub.js.map +1 -1
- package/dist/test/pub2.js +8 -10
- package/dist/test/pub2.js.map +1 -1
- package/dist/test/reject.js +16 -20
- package/dist/test/reject.js.map +1 -1
- package/dist/test/services.js +19 -21
- package/dist/test/services.js.map +1 -1
- package/dist/test/stress.js +7 -9
- package/dist/test/stress.js.map +1 -1
- package/dist/test/timing.js +27 -33
- package/dist/test/timing.js.map +1 -1
- package/dist/types.js +4 -7
- package/dist/types.js.map +1 -1
- package/dist/worker.d.ts +3 -3
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +52 -50
- package/dist/worker.js.map +1 -1
- package/package.json +20 -14
- package/src/EbusReject.ts +1 -1
- package/src/EbusUnpackedResult.ts +3 -3
- package/src/broker.ts +6 -6
- package/src/client.ts +1 -1
- package/src/clientBlocking.ts +9 -9
- package/src/clientNonBlocking.ts +9 -9
- package/src/consts.ts +1 -1
- package/src/delayWorker.ts +3 -3
- package/src/echoWorker.ts +2 -2
- package/src/errorWorker.ts +3 -3
- package/src/index.ts +18 -18
- package/src/loadConfiguration.ts +2 -2
- package/src/pub.ts +3 -3
- package/src/rejectWorker.ts +3 -4
- package/src/run/all.ts +5 -6
- package/src/run/broker.ts +1 -1
- package/src/run/call.ts +26 -11
- package/src/run/calling.ts +2 -2
- package/src/run/callingBurst.ts +2 -2
- package/src/run/delay.ts +1 -1
- package/src/run/echo.ts +1 -1
- package/src/run/error.ts +1 -1
- package/src/run/ping.ts +10 -9
- package/src/run/pub.ts +1 -1
- package/src/run/reject.ts +1 -1
- package/src/run/sub.ts +23 -22
- package/src/run/workers.ts +8 -14
- package/src/serialize.ts +1 -1
- package/src/service.ts +1 -1
- package/src/sub.ts +4 -4
- package/src/test/config.ts +3 -3
- package/src/test/echo.ts +4 -4
- package/src/test/pack.ts +1 -3
- package/src/test/performance.ts +4 -4
- package/src/test/pub.ts +6 -6
- package/src/test/pub2.ts +4 -6
- package/src/test/reject.ts +4 -5
- package/src/test/services.ts +3 -3
- package/src/test/stress.ts +2 -2
- package/src/test/timing.ts +5 -5
- package/src/worker.ts +7 -7
- package/tsconfig.json +3 -3
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,MAGX;AAHD,WAAY,MAAM;IACd,wBAAc,CAAA;IACd,wBAAc,CAAA;AAClB,CAAC,EAHW,MAAM,GAAN,MAAM,KAAN,MAAM,QAGjB;AAED,MAAM,CAAN,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACf,sBAAa,CAAA;IACb,2BAAc,CAAA;IACd,6BAAgB,CAAA;IAChB,2BAAc,CAAA;IACd,2BAAc,CAAA;IACd,4BAAe,CAAA;IACf,6BAAgB,CAAA;IAChB,+BAAkB,CAAA;IAClB,4BAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,6BAAgB,CAAA;IAChB,+BAAkB,CAAA;IAClB,6BAAgB,CAAA;IAChB,8BAAiB,CAAA;IACjB,wCAA2B,CAAA;IAC3B,uCAA0B,CAAA;AAC9B,CAAC,EAjBW,OAAO,GAAP,OAAO,KAAP,OAAO,QAiBlB"}
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { Dealer } from "zeromq";
|
|
3
|
-
import { EbusConfiguration } from "./EbusConfiguration";
|
|
4
|
-
import { EbusRequestOptions } from "./EbusRequestOptions";
|
|
3
|
+
import { EbusConfiguration } from "./EbusConfiguration.js";
|
|
4
|
+
import { EbusRequestOptions } from "./EbusRequestOptions.js";
|
|
5
5
|
export declare class Worker {
|
|
6
6
|
address: string;
|
|
7
7
|
service: string;
|
package/dist/worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAU5D,qBAAa,MAAM;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,SAAK;IACZ,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,aAAa,EAAE,iBAAiB,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAA;IACpC,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;gBAEP,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAM;IAYhE,IAAI;IAYV,cAAc;IAgCR,KAAK;IAuFE,OAAO,CAAC,GAAG,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG;YAMnC,cAAc;YAuDd,WAAW;IAmBnB,IAAI;IAoBJ,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAerC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,GAAG,GAAG;QAAC,IAAI,EAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAC,CAAC;CAG9H"}
|
package/dist/worker.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const serialize_1 = require("./serialize");
|
|
9
|
-
const sleep_1 = require("./sleep");
|
|
10
|
-
const EbusReject_1 = require("./EbusReject");
|
|
1
|
+
import { Log, serialize } from "cry-helpers";
|
|
2
|
+
import { Dealer } from "zeromq";
|
|
3
|
+
import { loadConfiguration } from "./loadConfiguration.js";
|
|
4
|
+
import { Header, Message } from "./types.js";
|
|
5
|
+
import { pack, unpack } from "./serialize.js";
|
|
6
|
+
import { sleep } from "./sleep.js";
|
|
7
|
+
import { EbusRejectError } from "./EbusReject.js";
|
|
11
8
|
const prefixes = ["EBUS_WORKER", "EBUS"];
|
|
12
|
-
const log = new
|
|
13
|
-
class Worker {
|
|
9
|
+
const log = new Log(prefixes);
|
|
10
|
+
export class Worker {
|
|
11
|
+
address;
|
|
12
|
+
service = "";
|
|
13
|
+
socket;
|
|
14
|
+
configuration;
|
|
15
|
+
interval;
|
|
16
|
+
lastHeartbeat;
|
|
17
|
+
processing;
|
|
14
18
|
constructor(service, config = {}) {
|
|
15
|
-
this.service = "";
|
|
16
19
|
this.service = service || this.service;
|
|
17
|
-
this.configuration =
|
|
20
|
+
this.configuration = loadConfiguration(prefixes, config);
|
|
18
21
|
this.address = this.configuration.address;
|
|
19
22
|
this.lastHeartbeat = new Date().valueOf();
|
|
20
23
|
this.processing = false;
|
|
@@ -32,7 +35,7 @@ class Worker {
|
|
|
32
35
|
log.status(`worker for ${this.service} stopped`);
|
|
33
36
|
process.exit(0);
|
|
34
37
|
}
|
|
35
|
-
catch
|
|
38
|
+
catch { }
|
|
36
39
|
}
|
|
37
40
|
startHeartbeat() {
|
|
38
41
|
if (this.interval)
|
|
@@ -44,7 +47,7 @@ class Worker {
|
|
|
44
47
|
try {
|
|
45
48
|
try {
|
|
46
49
|
if (this.socket) {
|
|
47
|
-
await this.socket.send([null,
|
|
50
|
+
await this.socket.send([null, Header.Worker, Message.Heartbeat, this.service, null, null]);
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
catch (err) {
|
|
@@ -66,10 +69,10 @@ class Worker {
|
|
|
66
69
|
async start() {
|
|
67
70
|
log.debug(`worker for ${this.service} is starting`);
|
|
68
71
|
const loop = async () => {
|
|
69
|
-
this.socket = new
|
|
72
|
+
this.socket = new Dealer();
|
|
70
73
|
this.socket.reconnectInterval = 100;
|
|
71
74
|
await this.socket.connect(this.configuration.address);
|
|
72
|
-
await this.socket.send([null,
|
|
75
|
+
await this.socket.send([null, Header.Worker, Message.Ready, this.service]);
|
|
73
76
|
await this.socket.receive();
|
|
74
77
|
log.status(`started worker for ${this.service} on ${this.configuration.address}`);
|
|
75
78
|
this.startHeartbeat();
|
|
@@ -77,17 +80,17 @@ class Worker {
|
|
|
77
80
|
this.lastHeartbeat = new Date().valueOf();
|
|
78
81
|
try {
|
|
79
82
|
switch (type.toString()) {
|
|
80
|
-
case
|
|
83
|
+
case Message.Shutdown:
|
|
81
84
|
log.status(`worker for ${this.service} received broker shutdown signal`);
|
|
82
85
|
break;
|
|
83
|
-
case
|
|
86
|
+
case Message.Heartbeat:
|
|
84
87
|
log.trace(`worker for ${this.service} received heartbeat from broker`);
|
|
85
88
|
break;
|
|
86
|
-
case
|
|
89
|
+
case Message.ShutdownAndRestart:
|
|
87
90
|
log.status(`worker for ${this.service} received ShutdownAndRestart from broker`);
|
|
88
91
|
process.exit(1);
|
|
89
92
|
break;
|
|
90
|
-
case
|
|
93
|
+
case Message.Request:
|
|
91
94
|
this.processing = true;
|
|
92
95
|
await this.processRequest(reqId, optBuff, type, req, client);
|
|
93
96
|
this.processing = false;
|
|
@@ -127,43 +130,43 @@ class Worker {
|
|
|
127
130
|
console.log('worker/onError - should override');
|
|
128
131
|
}
|
|
129
132
|
async processRequest(reqId, optBuff, type, req, client) {
|
|
130
|
-
let opts =
|
|
133
|
+
let opts = serialize.unpack(optBuff);
|
|
131
134
|
log.debug(`worker for ${this.service} received request ${type} with opts`, opts);
|
|
132
135
|
let timeout = opts.receiveTimeout || this.configuration.receiveTimeout;
|
|
133
|
-
let responseMessageType =
|
|
136
|
+
let responseMessageType = Message.Reply;
|
|
134
137
|
let promises = [
|
|
135
|
-
this.process(
|
|
136
|
-
|
|
138
|
+
this.process(unpack(req, opts), opts),
|
|
139
|
+
sleep(timeout, new EbusRejectError("timeout", `timeout in worker for '${this.service}' after ${timeout} ms`, opts))
|
|
137
140
|
];
|
|
138
141
|
let rep;
|
|
139
142
|
try {
|
|
140
143
|
rep = await Promise.race(promises);
|
|
141
|
-
if (rep instanceof
|
|
142
|
-
log.warn(`request expired at worker for '${this.service}' after ${timeout} ms with opts ${
|
|
144
|
+
if (rep instanceof EbusRejectError && rep.reason === "timeout") {
|
|
145
|
+
log.warn(`request expired at worker for '${this.service}' after ${timeout} ms with opts ${serialize.pack(opts)}`);
|
|
143
146
|
console.log('opts', opts);
|
|
144
|
-
log.warn(
|
|
145
|
-
responseMessageType =
|
|
146
|
-
this.onError("timeout",
|
|
147
|
+
log.warn(unpack(req, opts));
|
|
148
|
+
responseMessageType = Message.Timeout;
|
|
149
|
+
this.onError("timeout", unpack(req, opts), opts);
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
catch (err) {
|
|
150
153
|
rep = err;
|
|
151
|
-
if (!(rep instanceof
|
|
152
|
-
rep = new
|
|
153
|
-
responseMessageType =
|
|
154
|
+
if (!(rep instanceof EbusRejectError)) {
|
|
155
|
+
rep = new EbusRejectError("error", `error in worker for '${this.service}' process method: '${err.message}'`, err);
|
|
156
|
+
responseMessageType = Message.Error;
|
|
154
157
|
}
|
|
155
|
-
if (rep instanceof
|
|
156
|
-
responseMessageType =
|
|
157
|
-
if (rep instanceof
|
|
158
|
-
responseMessageType =
|
|
159
|
-
if (rep instanceof
|
|
160
|
-
responseMessageType =
|
|
161
|
-
this.onError(err,
|
|
158
|
+
if (rep instanceof EbusRejectError && rep.reason === "timeout")
|
|
159
|
+
responseMessageType = Message.Timeout;
|
|
160
|
+
if (rep instanceof EbusRejectError && rep.reason === "reject")
|
|
161
|
+
responseMessageType = Message.Reject;
|
|
162
|
+
if (rep instanceof EbusRejectError && rep.reason === "error")
|
|
163
|
+
responseMessageType = Message.Error;
|
|
164
|
+
this.onError(err, unpack(req, opts), opts);
|
|
162
165
|
}
|
|
163
166
|
let data = rep;
|
|
164
|
-
if (rep instanceof
|
|
167
|
+
if (rep instanceof EbusRejectError)
|
|
165
168
|
opts = { zip: false, raw: false, returningError: true, };
|
|
166
|
-
if (
|
|
169
|
+
if (rep?.data !== undefined && rep?.opts !== undefined) {
|
|
167
170
|
opts = req.opts;
|
|
168
171
|
data = rep.data;
|
|
169
172
|
}
|
|
@@ -174,13 +177,13 @@ class Worker {
|
|
|
174
177
|
try {
|
|
175
178
|
await this.socket.send([
|
|
176
179
|
null,
|
|
177
|
-
|
|
180
|
+
Header.Worker,
|
|
178
181
|
responseMessageType,
|
|
179
182
|
client,
|
|
180
183
|
null,
|
|
181
184
|
reqId,
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
serialize.pack(opts),
|
|
186
|
+
pack(data, opts),
|
|
184
187
|
]);
|
|
185
188
|
}
|
|
186
189
|
catch (err) {
|
|
@@ -197,8 +200,8 @@ class Worker {
|
|
|
197
200
|
if (this.socket && !this.socket.closed) {
|
|
198
201
|
await this.socket.send([
|
|
199
202
|
null,
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
Header.Worker,
|
|
204
|
+
Message.Disconnect,
|
|
202
205
|
this.service,
|
|
203
206
|
]);
|
|
204
207
|
log.debug(`worker for ${this.service} is closing socket`);
|
|
@@ -210,7 +213,7 @@ class Worker {
|
|
|
210
213
|
log.error(`worker for '${this.service}' not connected, cannot publish to ${channel}`, message);
|
|
211
214
|
return;
|
|
212
215
|
}
|
|
213
|
-
await this.socket.send([null,
|
|
216
|
+
await this.socket.send([null, Header.Worker, Message.Publish, channel, pack(message, {})]);
|
|
214
217
|
log.debug(`ebus worker published on '${channel}'`, message);
|
|
215
218
|
// let socket = new Request()
|
|
216
219
|
// await socket.connect(this.configuration.address)
|
|
@@ -222,5 +225,4 @@ class Worker {
|
|
|
222
225
|
throw new Error(`worker for service ${this.service} must implement process()`);
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
|
-
exports.Worker = Worker;
|
|
226
228
|
//# sourceMappingURL=worker.js.map
|
package/dist/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAG,SAAS,EAAC,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;A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CACJ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cry-ebus2",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
@@ -14,21 +15,26 @@
|
|
|
14
15
|
"author": "Primož Krajnik",
|
|
15
16
|
"license": "ISC",
|
|
16
17
|
"devDependencies": {
|
|
17
|
-
"@types/
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"@types/dotenv": "^8.2.0",
|
|
19
|
+
"@types/node": "^18.7.1",
|
|
20
|
+
"deep-equal-in-any-order": "^2.0.0",
|
|
21
|
+
"i": "^0.3.7",
|
|
22
|
+
"npm": "^8.17.0",
|
|
23
|
+
"typescript": "^4.7.4"
|
|
20
24
|
},
|
|
21
25
|
"dependencies": {
|
|
22
|
-
"
|
|
23
|
-
"@types/
|
|
24
|
-
"@types/
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
26
|
+
"-": "^0.0.1",
|
|
27
|
+
"@types/chai": "^4.3.3",
|
|
28
|
+
"@types/mocha": "^9.1.1",
|
|
29
|
+
"@types/pako": "^2.0.0",
|
|
30
|
+
"chai": "^4.3.6",
|
|
31
|
+
"commander": "^9.4.0",
|
|
32
|
+
"cry-helpers": "^2.1.63",
|
|
33
|
+
"dotenv": "^16.0.1",
|
|
34
|
+
"mocha": "^10.0.0",
|
|
35
|
+
"notepack.io": "^3.0.1",
|
|
31
36
|
"pako": "^2.0.4",
|
|
32
|
-
"tiny-typed-emitter": "^2.1.0"
|
|
37
|
+
"tiny-typed-emitter": "^2.1.0",
|
|
38
|
+
"zeromq": "^6.0.0-beta.6"
|
|
33
39
|
}
|
|
34
40
|
}
|
package/src/EbusReject.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EbusRequestOptions } from "./EbusRequestOptions";
|
|
2
|
-
import { unpack } from "./serialize";
|
|
3
|
-
import { Message } from "./types";
|
|
1
|
+
import { EbusRequestOptions } from "./EbusRequestOptions.js";
|
|
2
|
+
import { unpack } from "./serialize.js";
|
|
3
|
+
import { Message } from "./types.js";
|
|
4
4
|
|
|
5
5
|
export class EbusUnpackedResult<T> {
|
|
6
6
|
opts: Partial<EbusRequestOptions>
|
package/src/broker.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Log, serialize } from "cry-helpers"
|
|
2
2
|
import { Publisher, Router } from "zeromq"
|
|
3
|
-
import { EbusConfiguration } from "./EbusConfiguration"
|
|
4
|
-
import { EbusRequestOptions } from "./EbusRequestOptions"
|
|
5
|
-
import { loadConfiguration } from "./loadConfiguration"
|
|
6
|
-
import { pack } from "./serialize"
|
|
7
|
-
import { Service } from "./service"
|
|
8
|
-
import { Header, Message } from "./types"
|
|
3
|
+
import { EbusConfiguration } from "./EbusConfiguration.js"
|
|
4
|
+
import { EbusRequestOptions } from "./EbusRequestOptions.js"
|
|
5
|
+
import { loadConfiguration } from "./loadConfiguration.js"
|
|
6
|
+
import { pack } from "./serialize.js"
|
|
7
|
+
import { Service } from "./service.js"
|
|
8
|
+
import { Header, Message } from "./types.js"
|
|
9
9
|
const prefixes = ["EBUS_BROKER", "EBUS"]
|
|
10
10
|
const log = new Log(prefixes)
|
|
11
11
|
|
package/src/client.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
export { ClientNonBlocking as Client } from "./clientNonBlocking";
|
|
2
|
+
export { ClientNonBlocking as Client } from "./clientNonBlocking.js";
|
package/src/clientBlocking.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
1
|
|
2
2
|
import { Log, serialize } from "cry-helpers"
|
|
3
3
|
import { Request } from "zeromq"
|
|
4
|
-
import { EbusConfiguration } from "./EbusConfiguration"
|
|
5
|
-
import { EbusRequestOptions } from "./EbusRequestOptions"
|
|
6
|
-
import { loadConfiguration } from "./loadConfiguration"
|
|
7
|
-
import { Header, Message } from "./types"
|
|
8
|
-
import { pack, unpack } from "./serialize"
|
|
9
|
-
import { EbusRejectError } from "./EbusReject"
|
|
10
|
-
import { EbusUnpackedResult } from "./EbusUnpackedResult"
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
import { EbusConfiguration } from "./EbusConfiguration.js"
|
|
5
|
+
import { EbusRequestOptions } from "./EbusRequestOptions.js"
|
|
6
|
+
import { loadConfiguration } from "./loadConfiguration.js"
|
|
7
|
+
import { Header, Message } from "./types.js"
|
|
8
|
+
import { pack, unpack } from "./serialize.js"
|
|
9
|
+
import { EbusRejectError } from "./EbusReject.js"
|
|
10
|
+
import { EbusUnpackedResult } from "./EbusUnpackedResult.js"
|
|
11
|
+
import { EbusClientEvents } from "./EbusClientEvents.js"
|
|
12
|
+
import { TypedEmitter } from "tiny-typed-emitter"
|
|
13
13
|
|
|
14
14
|
const prefixes = ["EBUS_CLIENT", "EBUS"]
|
|
15
15
|
let log = new Log(prefixes)
|
package/src/clientNonBlocking.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
1
|
|
2
2
|
import { Log, serialize } from "cry-helpers"
|
|
3
3
|
import { Request } from "zeromq"
|
|
4
|
-
import { EbusConfiguration } from "./EbusConfiguration"
|
|
5
|
-
import { EbusRequestOptions } from "./EbusRequestOptions"
|
|
6
|
-
import { loadConfiguration } from "./loadConfiguration"
|
|
7
|
-
import { Header, Message } from "./types"
|
|
8
|
-
import { pack, unpack } from "./serialize"
|
|
9
|
-
import { EbusRejectError } from "./EbusReject"
|
|
10
|
-
import { EbusUnpackedResult } from "./EbusUnpackedResult"
|
|
4
|
+
import { EbusConfiguration } from "./EbusConfiguration.js"
|
|
5
|
+
import { EbusRequestOptions } from "./EbusRequestOptions.js"
|
|
6
|
+
import { loadConfiguration } from "./loadConfiguration.js"
|
|
7
|
+
import { Header, Message } from "./types.js"
|
|
8
|
+
import { pack, unpack } from "./serialize.js"
|
|
9
|
+
import { EbusRejectError } from "./EbusReject.js"
|
|
10
|
+
import { EbusUnpackedResult } from "./EbusUnpackedResult.js"
|
|
11
|
+
import DeferredPromise from "cry-helpers/dist/defferedpromise.js"
|
|
12
|
+
import { EbusClientEvents } from "./EbusClientEvents.js"
|
|
11
13
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
12
|
-
import DeferredPromise from "cry-helpers/dist/defferedpromise"
|
|
13
|
-
import { EbusClientEvents } from "./EbusClientEvents"
|
|
14
14
|
|
|
15
15
|
const prefixes = ["EBUS_CLIENT", "EBUS"]
|
|
16
16
|
let log = new Log(prefixes)
|
package/src/consts.ts
CHANGED
package/src/delayWorker.ts
CHANGED
package/src/echoWorker.ts
CHANGED
package/src/errorWorker.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EbusRejectError } from "./EbusReject"
|
|
2
|
-
import { sleep } from "./sleep"
|
|
3
|
-
import { Worker } from "./worker"
|
|
1
|
+
import { EbusRejectError } from "./EbusReject.js"
|
|
2
|
+
import { sleep } from "./sleep.js"
|
|
3
|
+
import { Worker } from "./worker.js"
|
|
4
4
|
|
|
5
5
|
export interface ErrorRequest
|
|
6
6
|
{
|
package/src/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export * from "./broker"
|
|
2
|
-
export * from "./worker"
|
|
3
|
-
export * from "./client"
|
|
4
|
-
export * from "./clientBlocking"
|
|
5
|
-
export * from "./clientNonBlocking"
|
|
6
|
-
export * from "./echoWorker"
|
|
7
|
-
export * from "./delayWorker"
|
|
8
|
-
export * from "./errorWorker"
|
|
9
|
-
export * from "./rejectWorker"
|
|
10
|
-
export * from "./pub"
|
|
11
|
-
export * from "./sub"
|
|
12
|
-
export * from "./serialize"
|
|
13
|
-
export * from "./sleep"
|
|
14
|
-
export * from "./block"
|
|
1
|
+
export * from "./broker.js"
|
|
2
|
+
export * from "./worker.js"
|
|
3
|
+
export * from "./client.js"
|
|
4
|
+
export * from "./clientBlocking.js"
|
|
5
|
+
export * from "./clientNonBlocking.js"
|
|
6
|
+
export * from "./echoWorker.js"
|
|
7
|
+
export * from "./delayWorker.js"
|
|
8
|
+
export * from "./errorWorker.js"
|
|
9
|
+
export * from "./rejectWorker.js"
|
|
10
|
+
export * from "./pub.js"
|
|
11
|
+
export * from "./sub.js"
|
|
12
|
+
export * from "./serialize.js"
|
|
13
|
+
export * from "./sleep.js"
|
|
14
|
+
export * from "./block.js"
|
|
15
15
|
|
|
16
|
-
export { EbusConfiguration } from "./EbusConfiguration"
|
|
17
|
-
export { EbusRequestOptions } from "./EbusRequestOptions"
|
|
18
|
-
export { EbusUnpackedResult } from "./EbusUnpackedResult"
|
|
19
|
-
export { EbusClientEvents } from "./EbusClientEvents"
|
|
16
|
+
export { EbusConfiguration } from "./EbusConfiguration.js"
|
|
17
|
+
export { EbusRequestOptions } from "./EbusRequestOptions.js"
|
|
18
|
+
export { EbusUnpackedResult } from "./EbusUnpackedResult.js"
|
|
19
|
+
export { EbusClientEvents } from "./EbusClientEvents.js"
|
package/src/loadConfiguration.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getConf } from "cry-helpers";
|
|
2
|
-
import { defaults } from "./consts";
|
|
3
|
-
import { EbusConfiguration } from "./EbusConfiguration";
|
|
2
|
+
import { defaults } from "./consts.js";
|
|
3
|
+
import { EbusConfiguration } from "./EbusConfiguration.js";
|
|
4
4
|
|
|
5
5
|
export function loadConfiguration(prefixes: string[], override: Partial<EbusConfiguration> = {})
|
|
6
6
|
: EbusConfiguration
|
package/src/pub.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { Log } from "cry-helpers"
|
|
3
3
|
import { Publisher } from "zeromq"
|
|
4
|
-
import { EbusConfiguration } from "./EbusConfiguration"
|
|
5
|
-
import { loadConfiguration } from "./loadConfiguration"
|
|
6
|
-
import { pack } from "./serialize"
|
|
4
|
+
import { EbusConfiguration } from "./EbusConfiguration.js"
|
|
5
|
+
import { loadConfiguration } from "./loadConfiguration.js"
|
|
6
|
+
import { pack } from "./serialize.js"
|
|
7
7
|
|
|
8
8
|
const prefixes = ["EBUS_PUB", "EBUS"]
|
|
9
9
|
const log = new Log(prefixes)
|
package/src/rejectWorker.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Worker } from "./worker"
|
|
1
|
+
import { EbusRejectError } from "./EbusReject.js"
|
|
2
|
+
import { sleep } from "./sleep.js"
|
|
3
|
+
import { Worker } from "./worker.js"
|
|
5
4
|
|
|
6
5
|
export interface RejectRequest
|
|
7
6
|
{
|
package/src/run/all.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Broker } from "../broker";
|
|
2
|
-
import { DelayWorker } from "../delayWorker";
|
|
3
|
-
import { EchoWorker } from "../echoWorker";
|
|
4
|
-
import { ErrorWorker } from "../errorWorker";
|
|
5
|
-
import { RejectWorker } from "../rejectWorker";
|
|
1
|
+
import { Broker } from "../broker.js";
|
|
2
|
+
import { DelayWorker } from "../delayWorker.js";
|
|
3
|
+
import { EchoWorker } from "../echoWorker.js";
|
|
4
|
+
import { ErrorWorker } from "../errorWorker.js";
|
|
5
|
+
import { RejectWorker } from "../rejectWorker.js";
|
|
6
6
|
|
|
7
7
|
import { config } from "dotenv"
|
|
8
|
-
import { Sub } from "../sub";
|
|
9
8
|
config()
|
|
10
9
|
|
|
11
10
|
new Broker().start()
|