@nsshunt/stsappframework 2.19.205 → 2.19.207
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/masterprocessbase.js +18 -68
- package/dist/masterprocessbase.js.map +1 -1
- package/dist/processbase.js +59 -1
- package/dist/processbase.js.map +1 -1
- package/dist/processoptions.js +9 -0
- package/dist/processoptions.js.map +1 -1
- package/dist/serverprocessbase.js +342 -0
- package/dist/serverprocessbase.js.map +1 -0
- package/dist/singleprocessbase.js +13 -220
- package/dist/singleprocessbase.js.map +1 -1
- package/dist/tcpclient/app.js +21 -0
- package/dist/tcpclient/app.js.map +1 -0
- package/dist/tcpclient/app2.js +55 -0
- package/dist/tcpclient/app2.js.map +1 -0
- package/dist/tcpclientserver/app.js +15 -0
- package/dist/tcpclientserver/app.js.map +1 -0
- package/dist/tcpclientserver/appConfig.js +61 -0
- package/dist/tcpclientserver/appConfig.js.map +1 -0
- package/dist/workerprocessbase.js +15 -224
- package/dist/workerprocessbase.js.map +1 -1
- package/package.json +3 -2
- package/run.sh +24 -0
- package/runc1.sh +24 -0
- package/runc2.sh +24 -0
- package/src/commonTypes.ts +1 -1
- package/src/masterprocessbase.ts +11 -66
- package/src/processbase.ts +62 -2
- package/src/processoptions.ts +9 -9
- package/src/serverprocessbase.ts +390 -0
- package/src/singleprocessbase.ts +20 -254
- package/src/tcpclient/app.ts +19 -0
- package/src/tcpclient/app2.ts +55 -0
- package/src/tcpclientserver/app.ts +9 -0
- package/src/tcpclientserver/appConfig.ts +66 -0
- package/src/workerprocessbase.ts +24 -251
- package/types/commonTypes.d.ts +1 -1
- package/types/commonTypes.d.ts.map +1 -1
- package/types/masterprocessbase.d.ts.map +1 -1
- package/types/processbase.d.ts +4 -0
- package/types/processbase.d.ts.map +1 -1
- package/types/processoptions.d.ts +8 -8
- package/types/processoptions.d.ts.map +1 -1
- package/types/serverprocessbase.d.ts +21 -0
- package/types/serverprocessbase.d.ts.map +1 -0
- package/types/singleprocessbase.d.ts +3 -7
- package/types/singleprocessbase.d.ts.map +1 -1
- package/types/tcpclient/app.d.ts +2 -0
- package/types/tcpclient/app.d.ts.map +1 -0
- package/types/tcpclient/app2.d.ts +2 -0
- package/types/tcpclient/app2.d.ts.map +1 -0
- package/types/tcpclientserver/app.d.ts +2 -0
- package/types/tcpclientserver/app.d.ts.map +1 -0
- package/types/tcpclientserver/appConfig.d.ts +3 -0
- package/types/tcpclientserver/appConfig.d.ts.map +1 -0
- package/types/workerprocessbase.d.ts +2 -7
- package/types/workerprocessbase.d.ts.map +1 -1
package/src/workerprocessbase.ts
CHANGED
|
@@ -10,13 +10,16 @@ import { createAdapter } from "@socket.io/redis-streams-adapter";
|
|
|
10
10
|
import { Gauge, InstrumentGaugeTelemetry } from '@nsshunt/stsinstrumentation'
|
|
11
11
|
import { JSONObject, Sleep } from '@nsshunt/stsutils'
|
|
12
12
|
|
|
13
|
-
import { ProcessOptions } from './processoptions'
|
|
13
|
+
import { ProcessOptions, STSServerType } from './processoptions'
|
|
14
14
|
import { ProcessBase } from './processbase';
|
|
15
15
|
|
|
16
16
|
import { register, Counter, collectDefaultMetrics, AggregatorRegistry } from 'prom-client'
|
|
17
17
|
|
|
18
18
|
import { createServer as createServerHttps } from 'https'
|
|
19
19
|
import { createServer } from 'http'
|
|
20
|
+
import tls from 'node:tls'
|
|
21
|
+
import net from 'node:net'
|
|
22
|
+
|
|
20
23
|
import { Server, ServerOptions } from "socket.io";
|
|
21
24
|
|
|
22
25
|
import { v4 as uuidv4 } from 'uuid';
|
|
@@ -27,17 +30,17 @@ import { Express } from 'express'
|
|
|
27
30
|
|
|
28
31
|
import { createClient, RedisClientType } from 'redis';
|
|
29
32
|
|
|
33
|
+
import { ServerProcessBase } from './serverprocessbase'
|
|
34
|
+
|
|
35
|
+
import jayson from 'jayson'
|
|
36
|
+
|
|
30
37
|
/**
|
|
31
38
|
* todo
|
|
32
39
|
* @typedef {Object} options - todo
|
|
33
40
|
* @property {boolean} [wssServer=false] - Create a web socket server on this worker instance
|
|
34
41
|
*/
|
|
35
|
-
export class WorkerProcessBase extends
|
|
42
|
+
export class WorkerProcessBase extends ServerProcessBase implements IWorkerProcessBase
|
|
36
43
|
{
|
|
37
|
-
#io: Server | null = null;
|
|
38
|
-
#redisClient: RedisClientType | null = null;
|
|
39
|
-
#httpServer: any = null;
|
|
40
|
-
#expressServer: STSExpressServer | null = null;
|
|
41
44
|
#inFlightMessage: IPCMessages = { }
|
|
42
45
|
#requestResponseMessageTimeout = 2000; //@@ config
|
|
43
46
|
|
|
@@ -45,10 +48,6 @@ export class WorkerProcessBase extends ProcessBase implements IWorkerProcessBase
|
|
|
45
48
|
super(options);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
get httpServer() {
|
|
49
|
-
return this.#httpServer;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
51
|
WorkerStarted() {
|
|
53
52
|
return null;
|
|
54
53
|
}
|
|
@@ -67,10 +66,6 @@ export class WorkerProcessBase extends ProcessBase implements IWorkerProcessBase
|
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
get io() {
|
|
71
|
-
return this.#io;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
69
|
#SendMessageToParentProcess = (message: IPCMessagePayload): Promise<JSONObject> => {
|
|
75
70
|
return new Promise((resolve, reject) => {
|
|
76
71
|
if (this.#inFlightMessage[message.id]) {
|
|
@@ -132,56 +127,6 @@ export class WorkerProcessBase extends ProcessBase implements IWorkerProcessBase
|
|
|
132
127
|
return;
|
|
133
128
|
}
|
|
134
129
|
|
|
135
|
-
// Setup server to Prometheus scrapes:
|
|
136
|
-
#SetupPrometheusEndPoints = (expressServer: Express) => {
|
|
137
|
-
// AggregatorRegistry is required here in the worker as well as the master in order for prom-client to work correctly.
|
|
138
|
-
new AggregatorRegistry();
|
|
139
|
-
|
|
140
|
-
const prefix = 'sts_';
|
|
141
|
-
|
|
142
|
-
collectDefaultMetrics({
|
|
143
|
-
labels: { NODE_APP_INSTANCE: process.pid },
|
|
144
|
-
prefix: prefix
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
const c = new Counter({
|
|
148
|
-
name: 'sts_test_counter',
|
|
149
|
-
help: 'Example of a counter',
|
|
150
|
-
labelNames: ['code'],
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
setInterval(() => {
|
|
154
|
-
c.inc({ code: 200 });
|
|
155
|
-
}, 1000).unref();
|
|
156
|
-
|
|
157
|
-
setInterval(() => {
|
|
158
|
-
c.inc({ code: 400 });
|
|
159
|
-
c.inc({ code: 'worker_' + process.pid });
|
|
160
|
-
}, 500).unref();
|
|
161
|
-
|
|
162
|
-
expressServer.get('/metrics', async (req: any, res: any) => {
|
|
163
|
-
try {
|
|
164
|
-
res.set('Content-Type', register.contentType);
|
|
165
|
-
res.end(await register.metrics());
|
|
166
|
-
} catch (ex) {
|
|
167
|
-
res.status(500).end(ex);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
expressServer.get('/metrics/counter', async (req: any, res: any) => {
|
|
172
|
-
try {
|
|
173
|
-
res.set('Content-Type', register.contentType);
|
|
174
|
-
res.end(await register.getSingleMetricAsString('test_counter'));
|
|
175
|
-
} catch (ex) {
|
|
176
|
-
res.status(500).end(ex);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
get expressServer() {
|
|
182
|
-
return this.#expressServer;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
130
|
SetupServer = async () =>
|
|
186
131
|
{
|
|
187
132
|
this.SetupInstrumentation();
|
|
@@ -190,100 +135,14 @@ export class WorkerProcessBase extends ProcessBase implements IWorkerProcessBase
|
|
|
190
135
|
}, 100);
|
|
191
136
|
}
|
|
192
137
|
|
|
193
|
-
SetupServerEx = async () =>
|
|
194
|
-
{
|
|
138
|
+
SetupServerEx = async () => {
|
|
195
139
|
this.ProcessStartup();
|
|
196
140
|
|
|
197
141
|
if (this.options.expressServerRouteFactory || this.options.expressServerRouteStaticFactory) {
|
|
198
|
-
this
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const LogEx = this.LogEx;
|
|
202
|
-
|
|
203
|
-
/*
|
|
204
|
-
if (this.instruments !== null) {
|
|
205
|
-
this.instruments[Gauge.LOGGER].consoleLogging = this.options.consoleLogging;
|
|
206
|
-
this.instruments[Gauge.LOGGER].instrumentLogging = this.options.instrumentLogging;
|
|
207
|
-
}
|
|
208
|
-
*/
|
|
209
|
-
|
|
210
|
-
LogEx(`Worker instance starting. Service instance Id: [${this.options.serviceInstanceId}]`);
|
|
211
|
-
|
|
212
|
-
this.#httpServer = null;
|
|
213
|
-
let shuttingDown = false;
|
|
214
|
-
|
|
215
|
-
const Terminate = async (performExit = true): Promise<void> =>
|
|
216
|
-
{
|
|
217
|
-
if (shuttingDown === false)
|
|
218
|
-
{
|
|
219
|
-
shuttingDown = true;
|
|
220
|
-
|
|
221
|
-
await this.ProcessTerminate();
|
|
222
|
-
|
|
223
|
-
await this.ProcessTerminating();
|
|
224
|
-
|
|
225
|
-
LogEx(`Stopping instruments.`);
|
|
226
|
-
//@@StopInstruments(this.instruments);
|
|
227
|
-
|
|
228
|
-
if (this.options.wssServer === true && this.#io !== null)
|
|
229
|
-
{
|
|
230
|
-
LogEx(`Disconnect Sockets.`);
|
|
231
|
-
if (this.socketIoHelper !== null) {
|
|
232
|
-
this.socketIoHelper.DisconnectSockets();
|
|
233
|
-
} else {
|
|
234
|
-
this.#io.disconnectSockets();
|
|
235
|
-
}
|
|
236
|
-
this.socketIoHelper = null;
|
|
237
|
-
this.#io = null;
|
|
238
|
-
// Note that this.#redisClient.disconnect() is not required becuase DisconnectSockets performs this action.
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (this.options.httpServer === true) {
|
|
242
|
-
LogEx(`Closing httpServer.`);
|
|
243
|
-
await this.#httpServer.close();
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (this.options.useDatabase) {
|
|
247
|
-
LogEx(`Ending database connections and pools.`);
|
|
248
|
-
await this.TerminateDatabase();
|
|
249
|
-
//await this.accessLayer.enddatabase();
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
LogEx(`Performing exit value: [${performExit}]`);
|
|
253
|
-
if (performExit) {
|
|
254
|
-
LogEx(`Process will self terminate with process.exit(0).`);
|
|
255
|
-
} else {
|
|
256
|
-
LogEx(`Child process will not self terminate. Terminate will be handled by master process.`);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (this.InstrumentController && this.InstrumentController.Workers.length > 0) {
|
|
260
|
-
setTimeout(() => {
|
|
261
|
-
if (this.InstrumentController && this.InstrumentController.Workers.length > 0) {
|
|
262
|
-
this.InstrumentController.InstrumentTerminate();
|
|
263
|
-
}
|
|
264
|
-
}, 100);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
//@@ always return here appears to always cleanly exit
|
|
268
|
-
// and cleanly exit from socket.io cluster adaptor
|
|
269
|
-
// without return here, socket.io cluster adaptor terminates in an error state
|
|
270
|
-
// as the implementation relies on cluster.on to send messages to worker threads
|
|
271
|
-
// but these have already been closed from the process.exit(0) below.
|
|
272
|
-
|
|
273
|
-
await Sleep(1000); // Allow socket.io time to clean-up
|
|
274
|
-
|
|
275
|
-
if (performExit) {
|
|
276
|
-
setTimeout(() => {
|
|
277
|
-
process.exit(0);
|
|
278
|
-
}, 0);
|
|
279
|
-
}
|
|
280
|
-
} else {
|
|
281
|
-
LogEx(`Process already terminating.`);
|
|
282
|
-
}
|
|
142
|
+
this.expressServer = new STSExpressServer(this.options, this);
|
|
283
143
|
}
|
|
284
144
|
|
|
285
|
-
|
|
286
|
-
//const self = this;
|
|
145
|
+
this.LogEx(`Worker instance starting. Service instance Id: [${this.options.serviceInstanceId}]`);
|
|
287
146
|
|
|
288
147
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
289
148
|
process.on('message', async (msg: any) => {
|
|
@@ -307,15 +166,15 @@ export class WorkerProcessBase extends ProcessBase implements IWorkerProcessBase
|
|
|
307
166
|
switch (msg.command)
|
|
308
167
|
{
|
|
309
168
|
case 'Terminate' :
|
|
310
|
-
LogEx((`Received ` + colors.bold(`Terminate`.italic) + ` message from master thread`).gray);
|
|
311
|
-
await Terminate(false); // Don't kill the child process here, the master will take care of that ...
|
|
169
|
+
this.LogEx((`Received ` + colors.bold(`Terminate`.italic) + ` message from master thread`).gray);
|
|
170
|
+
await this.Terminate(true, false); // Don't kill the child process here, the master will take care of that ...
|
|
312
171
|
break;
|
|
313
172
|
case 'TerminateAndKill' :
|
|
314
|
-
LogEx((`Received ` + colors.bold(`Terminate`.italic) + ` message from master thread`).gray);
|
|
315
|
-
await Terminate(true);
|
|
173
|
+
this.LogEx((`Received ` + colors.bold(`Terminate`.italic) + ` message from master thread`).gray);
|
|
174
|
+
await this.Terminate(true, true);
|
|
316
175
|
break;
|
|
317
176
|
case 'Message' :
|
|
318
|
-
LogEx((`Received ` + colors.bold(`Message`.italic) + ` message from master thread`).gray);
|
|
177
|
+
this.LogEx((`Received ` + colors.bold(`Message`.italic) + ` message from master thread`).gray);
|
|
319
178
|
this.ReceivedMessageFromMaster(msg.data);
|
|
320
179
|
break;
|
|
321
180
|
case 'Response' : // General response to a req/response interaction
|
|
@@ -324,110 +183,24 @@ export class WorkerProcessBase extends ProcessBase implements IWorkerProcessBase
|
|
|
324
183
|
}
|
|
325
184
|
});
|
|
326
185
|
|
|
327
|
-
|
|
328
|
-
if (this.options.httpServer === true) {
|
|
329
|
-
if (this.options.httpsServer === true) {
|
|
330
|
-
const options = {
|
|
331
|
-
key: fs.readFileSync(this.options.httpsServerKeyPath),
|
|
332
|
-
cert: fs.readFileSync(this.options.httpsServerCertificatePath)
|
|
333
|
-
};
|
|
334
|
-
this.#httpServer = createServerHttps(options, (this.#expressServer as STSExpressServer).App);
|
|
335
|
-
} else {
|
|
336
|
-
this.#httpServer = createServer((this.#expressServer as STSExpressServer).App);
|
|
337
|
-
}
|
|
338
|
-
//this.#httpServer.maxConnections = 50;
|
|
339
|
-
|
|
340
|
-
if (this.options.prometheusSupport === true) {
|
|
341
|
-
this.#SetupPrometheusEndPoints((this.#expressServer as STSExpressServer).App);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// Setup the web socket server (using socket.io) if enabled.
|
|
345
|
-
if (this.options.wssServer === true) {
|
|
346
|
-
// socket.io
|
|
347
|
-
// WebSocket
|
|
348
|
-
const options: Partial<ServerOptions> = {
|
|
349
|
-
transports: [ "websocket" ] // or [ "websocket", "polling" ] (to use long-poolling. Note that the order matters)
|
|
350
|
-
// The default path is /socket.io
|
|
351
|
-
// This can be changed with the path option as shown below
|
|
352
|
-
//,path: '/zzz'
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
//this.#io = require("socket.io")(this.#httpServer, options);
|
|
357
|
-
this.#io = new Server(this.#httpServer, options);
|
|
358
|
-
|
|
359
|
-
if (this.options.useRedisAdaptor) {
|
|
360
|
-
LogEx(`Using Redis for socket.io cluster management (worker)`);
|
|
361
|
-
if (this.options.redisAdaptorUrl) {
|
|
362
|
-
LogEx(`Redis url: [${this.options.redisAdaptorUrl}]`);
|
|
363
|
-
this.#redisClient = createClient({url: this.options.redisAdaptorUrl});
|
|
364
|
-
} else {
|
|
365
|
-
LogEx(`Redis url: [localhost]`);
|
|
366
|
-
this.#redisClient = createClient();
|
|
367
|
-
}
|
|
368
|
-
await this.#redisClient.connect();
|
|
369
|
-
this.#io.adapter(createAdapter(this.#redisClient) as any);
|
|
370
|
-
LogEx(`Redis successfully connected.`);
|
|
371
|
-
} else {
|
|
372
|
-
this.#io.adapter(clusterCreateAdapter() as any);
|
|
373
|
-
LogEx(`Using nodejs cluster mode for socket.io cluster management`);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
// To use a seperate socket server, the code below can be applied.
|
|
377
|
-
// this.#io = require("socket.io")(options);
|
|
378
|
-
// this.#io.adapter(createAdapter());
|
|
379
|
-
// this.#io.listen(3006);
|
|
380
|
-
// LogEx(`socket.io init`);
|
|
381
|
-
|
|
382
|
-
this.#io.engine.on("connection_error", (err) => {
|
|
383
|
-
LogEx(err.req); // the request object
|
|
384
|
-
LogEx(err.code); // the error code, for example 1
|
|
385
|
-
LogEx(err.message); // the error message, for example "Session ID unknown"
|
|
386
|
-
LogEx(err.context); // some additional error context
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
try {
|
|
391
|
-
// https://stackoverflow.com/questions/21342828/node-express-unix-domain-socket-permissions
|
|
392
|
-
//@@httpServer.listen('/tmp/stsrest01.sock').on('listening', () =>
|
|
393
|
-
//@@httpServer.listen('/var/run/sts/stsrest01.sock').on('listening', () =>
|
|
394
|
-
this.#httpServer.listen(this.options.listenPort, () => {
|
|
395
|
-
//@@chmodSync(this.options.port, 511);
|
|
396
|
-
}).on('listening', () =>
|
|
397
|
-
{
|
|
398
|
-
LogEx(`live on ${this.options.endpoint}:${this.options.listenPort}${this.options.apiRoot}`);
|
|
399
|
-
});
|
|
400
|
-
} catch (error)
|
|
401
|
-
{
|
|
402
|
-
console.error(error);
|
|
403
|
-
throw error;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/*
|
|
408
|
-
if (this.publishBroker !== null) {
|
|
409
|
-
setTimeout(() => {
|
|
410
|
-
this.publishBroker.StartPublish();
|
|
411
|
-
}, 0);
|
|
412
|
-
}
|
|
413
|
-
*/
|
|
414
|
-
|
|
415
186
|
// Signal Codes
|
|
416
187
|
// https://en.wikipedia.org/wiki/Signal_(IPC)
|
|
417
188
|
process.on('SIGTERM', async () =>
|
|
418
189
|
{
|
|
419
|
-
LogEx(`SIGTERM signal received for worker: ${process.pid}`);
|
|
420
|
-
await Terminate();
|
|
190
|
+
this.LogEx(`SIGTERM signal received for worker: ${process.pid}`);
|
|
191
|
+
await this.Terminate(true, true);
|
|
421
192
|
});
|
|
422
193
|
|
|
423
194
|
process.on('SIGINT', async () =>
|
|
424
195
|
{
|
|
425
|
-
LogEx(`SIGINT signal received for worker: ${process.pid}`);
|
|
426
|
-
await Terminate();
|
|
196
|
+
this.LogEx(`SIGINT signal received for worker: ${process.pid}`);
|
|
197
|
+
await this.Terminate(true, true);
|
|
427
198
|
});
|
|
428
199
|
|
|
200
|
+
await this.SetupSTSServer();
|
|
201
|
+
|
|
429
202
|
this.WorkerStarted();
|
|
430
203
|
|
|
431
|
-
LogEx(`Worker process:${process.pid} started`.green);
|
|
204
|
+
this.LogEx(`Worker process:${process.pid} started`.green);
|
|
432
205
|
};
|
|
433
206
|
}
|
package/types/commonTypes.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface ISingleProcessBase extends IProcessBase {
|
|
|
59
59
|
get expressServer(): any;
|
|
60
60
|
SetupServer(): Promise<boolean>;
|
|
61
61
|
SetupServerEx: () => Promise<void>;
|
|
62
|
-
|
|
62
|
+
TerminateApplication(): Promise<void>;
|
|
63
63
|
}
|
|
64
64
|
export interface IWorkerProcessBase extends IProcessBase {
|
|
65
65
|
get httpServer(): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonTypes.d.ts","sourceRoot":"","sources":["../src/commonTypes.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAChG,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,oBAAY,iBAAiB;IACzB,SAAS,cAAc;IACvB,YAAY,iBAAiB;CAChC;AAED,MAAM,WAAW,iBAAiB;IACjC,eAAe,EAAE,OAAO,CAAC;IACz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,MAAM,CAAC,iBAAiB,EAAE,uBAAuB,EAAE,iBAAiB,CAAC,CAAA;AAEnG,MAAM,WAAW,eAAe;IAE5B,UAAU,EAAE,CAAC,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACtE,SAAS,EAAE,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACnE,QAAQ,EAAE,CAAC,SAAS,EAAE,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3F,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,oBAAoB,CAAA;IAChK,YAAY,EAAE,CAAC,SAAS,EAAE,GAAG,KAAK,oBAAoB,CAAA;IACtD,iBAAiB,EAAE,MAAM,IAAI,CAAA;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterprocessbase.d.ts","sourceRoot":"","sources":["../src/masterprocessbase.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"masterprocessbase.d.ts","sourceRoot":"","sources":["../src/masterprocessbase.ts"],"names":[],"mappings":";;;;AA2BA,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAKnE,qBAAa,iBAAkB,SAAQ,WAAY,YAAW,kBAAkB;;gBAiBhE,OAAO,EAAE,cAAc;IAW1B,0BAA0B,IAAI,IAAI;IAQlC,wBAAwB,IAAI,qBAAqB;IAS1D;;;OAGA;IAEA,kBAAkB,CAAC,GAAG,EAAE,GAAG;IAqI3B,WAAW,sBAMV;IAqBD,UAAU,OAAQ,MAAM,+CAA+C,GAAG,eAAe,OAAO,gBAAgB,OAAO,KAAG,OAAO,CAwBhI;IAED,WAAW,WAAY,OAAO,OAAO,KAAG,IAAI,CAgB3C;IAUD,UAAU,QAAO,IAAI,CAIpB;IAED,UAAU,QAAO,IAAI,CAIpB;IAGD,SAAS,YAAa,GAAG,KAAG,MAAM,CAOjC;IAkED,aAAa,IAAI,IAAI;IAIrB,aAAa,sBA2KZ;IAED,sBAAsB,YAAa,GAAG,QAAQ,GAAG,UAahD;CACJ"}
|
package/types/processbase.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import colors from 'colors';
|
|
1
2
|
import { Gauge, InstrumentBaseTelemetry } from '@nsshunt/stsinstrumentation';
|
|
2
3
|
import { PGAccessLayer } from '@nsshunt/stsdatamanagement';
|
|
3
4
|
import { ProcessOptions } from './processoptions';
|
|
@@ -26,5 +27,8 @@ export declare abstract class ProcessBase extends STSOptionsBase implements IPro
|
|
|
26
27
|
set socketIoHelper(value: ISocketIoHelper | null);
|
|
27
28
|
TerminateDatabase(): Promise<void>;
|
|
28
29
|
get accessLayer(): PGAccessLayer | null;
|
|
30
|
+
GetNumCPUs: () => Promise<number>;
|
|
31
|
+
LogSystemTelemetry: () => Promise<void>;
|
|
32
|
+
GetSignalColour: (signal: any) => colors.Color;
|
|
29
33
|
}
|
|
30
34
|
//# sourceMappingURL=processbase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processbase.d.ts","sourceRoot":"","sources":["../src/processbase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processbase.d.ts","sourceRoot":"","sources":["../src/processbase.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAO3B,OAAO,EAAE,KAAK,EAAE,uBAAuB,EAA+E,MAAM,6BAA6B,CAAA;AAEzJ,OAAO,EAAE,aAAa,EAAyC,MAAM,4BAA4B,CAAA;AAKjG,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAc,MAAM,mBAAmB,CAAA;AAG9D,OAAO,EAAE,2BAA2B,EAAuC,qBAAqB,EAEvC,MAAM,6BAA6B,CAAA;AAQ5F,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAI7D,8BAAsB,WAAY,SAAQ,cAAe,YAAW,YAAY;;gBAShE,OAAO,EAAE,cAAc;IAUnC,IAAa,OAAO,IAAI,cAAc,CAErC;IAkGD,oBAAoB;IAuBpB,wBAAwB,IAAI,qBAAqB;IAIjD,0BAA0B,IAAI,IAAI;IAIlC,cAAc,aAuCb;IAED,gBAAgB,mBAAoB,KAAK,aAAa,uBAAuB,UAI5E;IAED,IAAI,oBAAoB,IAAI,2BAA2B,GAAG,IAAI,CAE7D;IAED,KAAK,YAAa,GAAG,UASpB;IAED,gBAAgB,CAAC,cAAc,EAAE,KAAK,GAAG,OAAO;IAQhD,gBAAgB,sBAMf;IAED;;;OAGA;IACA,eAAe,IAAI,GAAG;IAItB,IAAI,cAAc,IAAI,eAAe,GAAG,IAAI,CAG3C;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,EAG/C;IAgBK,iBAAiB;IAOvB,IAAI,WAAW,IAAI,aAAa,GAAG,IAAI,CAyBtC;IAED,UAAU,QAAa,QAAQ,MAAM,CAAC,CAkBrC;IAED,kBAAkB,sBA0BjB;IAED,eAAe,WAAY,GAAG,kBAQ5B;CACL"}
|
|
@@ -8,6 +8,13 @@ export interface STSExpressServer {
|
|
|
8
8
|
* Factory method that adds express routes to the express app object.
|
|
9
9
|
*/
|
|
10
10
|
export type ExpressRouteFactory = (app: express.Express, stsApp: IProcessBase) => void;
|
|
11
|
+
export declare enum STSServerType {
|
|
12
|
+
NONE = "NONE",
|
|
13
|
+
EXPRESS = "EXPRESS",
|
|
14
|
+
EXPRESS_TLS = "EXPRESS_TLS",
|
|
15
|
+
TCPRAW_TLS = "TCPRAW_TLS",
|
|
16
|
+
JSONRPC2_TLS = "JSONRPC_TLS"
|
|
17
|
+
}
|
|
11
18
|
export interface ProcessOptions {
|
|
12
19
|
/**
|
|
13
20
|
* Is this service worker the master worker (thread).
|
|
@@ -17,14 +24,7 @@ export interface ProcessOptions {
|
|
|
17
24
|
* Unique service instance ID (uuidv4).
|
|
18
25
|
*/
|
|
19
26
|
serviceInstanceId: string;
|
|
20
|
-
|
|
21
|
-
* Does this service run an HTTP server.
|
|
22
|
-
*/
|
|
23
|
-
httpServer: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Does this service run an HTTPS server. Note that httpServer must also be true if this value is true.
|
|
26
|
-
*/
|
|
27
|
-
httpsServer: boolean;
|
|
27
|
+
serverType: STSServerType;
|
|
28
28
|
/**
|
|
29
29
|
* HTTPS service public key path.
|
|
30
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processoptions.d.ts","sourceRoot":"","sources":["../src/processoptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,WAAW,gBAAgB;IAChC,IAAI,GAAG,IAAI,OAAO,CAAC,OAAO,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"processoptions.d.ts","sourceRoot":"","sources":["../src/processoptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,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AA;IAE/C;;;OAGG;IACH,+BAA+B,CAAC,EAAE,mBAAmB,CAAA;IAErD;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,yBAAyB,EAAE,OAAO,CAAA;IAElC,kCAAkC,EAAE,MAAM,CAAA;IAE1C,yBAAyB,EAAE,MAAM,CAAA;IAEjC,eAAe,EAAE,OAAO,CAAA;IAExB,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,gCAAgC,CAAC,EAAE,OAAO,CAAA;IAE1C,gCAAgC,CAAC,EAAE,MAAM,CAAA;CAC5C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ProcessOptions } from './processoptions';
|
|
2
|
+
import { ProcessBase } from './processbase';
|
|
3
|
+
import { Server } from "socket.io";
|
|
4
|
+
import { STSExpressServer } from './server';
|
|
5
|
+
/**
|
|
6
|
+
* todo
|
|
7
|
+
* @typedef {Object} options - todo
|
|
8
|
+
* @property {boolean} [wssServer=false] - Create a web socket server on this worker instance
|
|
9
|
+
*/
|
|
10
|
+
export declare class ServerProcessBase extends ProcessBase {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(options: ProcessOptions);
|
|
13
|
+
get httpServer(): any;
|
|
14
|
+
get io(): Server<import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any> | null;
|
|
15
|
+
get expressServer(): STSExpressServer | null;
|
|
16
|
+
set expressServer(val: STSExpressServer | null);
|
|
17
|
+
ProcessTerminating: () => Promise<void>;
|
|
18
|
+
Terminate: (clusterMode: boolean, clusterPerformExit: boolean, signal?: any) => Promise<void>;
|
|
19
|
+
SetupSTSServer: () => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=serverprocessbase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverprocessbase.d.ts","sourceRoot":"","sources":["../src/serverprocessbase.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C,OAAO,EAAE,MAAM,EAAiB,MAAM,WAAW,CAAC;AAKlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAO5C;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;;gBAUlC,OAAO,EAAE,cAAc;IAInC,IAAI,UAAU,QAEb;IAED,IAAI,EAAE,+LAEL;IAED,IAAI,aAAa,IAAI,gBAAgB,GAAG,IAAI,CAE3C;IACD,IAAI,aAAa,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,EAE7C;IAiMD,kBAAkB,QAAa,QAAQ,IAAI,CAAC,CAE3C;IASD,SAAS,gBAAuB,OAAO,sBAAsB,OAAO,WAAW,GAAG,KAAG,QAAQ,IAAI,CAAC,CAkGjG;IAED,cAAc,QAAY,QAAQ,IAAI,CAAC,CAetC;CACJ"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ProcessOptions } from './processoptions';
|
|
2
|
-
import { ProcessBase } from './processbase';
|
|
3
2
|
import { ISingleProcessBase } from './commonTypes';
|
|
4
3
|
import { InstrumentDefinitions } from '@nsshunt/stspublisherserver';
|
|
5
|
-
import {
|
|
4
|
+
import { ServerProcessBase } from './serverprocessbase';
|
|
6
5
|
export type EventCb = (socket: any, data: any) => void;
|
|
7
|
-
export declare class SingleProcessBase extends
|
|
6
|
+
export declare class SingleProcessBase extends ServerProcessBase implements ISingleProcessBase {
|
|
8
7
|
#private;
|
|
9
8
|
/**
|
|
10
9
|
*
|
|
@@ -20,11 +19,8 @@ export declare class SingleProcessBase extends ProcessBase implements ISinglePro
|
|
|
20
19
|
*/
|
|
21
20
|
GetUIController(): any;
|
|
22
21
|
ProcessStarted(): null;
|
|
23
|
-
get io(): any;
|
|
24
|
-
ProcessTerminating(): null;
|
|
25
|
-
get expressServer(): STSExpressServer | null;
|
|
26
22
|
SetupServer(): Promise<boolean>;
|
|
27
23
|
SetupServerEx: () => Promise<void>;
|
|
28
|
-
|
|
24
|
+
TerminateApplication(): Promise<void>;
|
|
29
25
|
}
|
|
30
26
|
//# sourceMappingURL=singleprocessbase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleprocessbase.d.ts","sourceRoot":"","sources":["../src/singleprocessbase.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"singleprocessbase.d.ts","sourceRoot":"","sources":["../src/singleprocessbase.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAA;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAUnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAA;AAEtD,qBAAa,iBAAkB,SAAQ,iBAAkB,YAAW,kBAAkB;;IAclF;;;OAGA;gBACY,OAAO,EAAE,cAAc;IAInC,IAAI,UAAU,QAGb;IAEQ,0BAA0B,IAAI,IAAI;IAQlC,wBAAwB,IAAI,qBAAqB;IAS1D;;;OAGA;IACS,eAAe,IAAI,GAAG;IAI/B,cAAc;IAId,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAmB/B,aAAa,sBAiCZ;IAEK,oBAAoB;CAK7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/tcpclient/app.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app2.d.ts","sourceRoot":"","sources":["../../src/tcpclient/app2.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/tcpclientserver/app.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appConfig.d.ts","sourceRoot":"","sources":["../../src/tcpclientserver/appConfig.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAA+B,MAAM,YAAY,CAAA;AAoBxE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,cAAc,CAuCtE"}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import { JSONObject } from '@nsshunt/stsutils';
|
|
2
2
|
import { ProcessOptions } from './processoptions';
|
|
3
|
-
import { ProcessBase } from './processbase';
|
|
4
|
-
import { Server } from "socket.io";
|
|
5
3
|
import { IWorkerProcessBase } from './commonTypes';
|
|
6
|
-
import {
|
|
4
|
+
import { ServerProcessBase } from './serverprocessbase';
|
|
7
5
|
/**
|
|
8
6
|
* todo
|
|
9
7
|
* @typedef {Object} options - todo
|
|
10
8
|
* @property {boolean} [wssServer=false] - Create a web socket server on this worker instance
|
|
11
9
|
*/
|
|
12
|
-
export declare class WorkerProcessBase extends
|
|
10
|
+
export declare class WorkerProcessBase extends ServerProcessBase implements IWorkerProcessBase {
|
|
13
11
|
#private;
|
|
14
12
|
constructor(options: ProcessOptions);
|
|
15
|
-
get httpServer(): any;
|
|
16
13
|
WorkerStarted(): null;
|
|
17
14
|
ReceivedMessageFromMaster(msg: any): void;
|
|
18
15
|
CollectAdditionalTelemetry(): void;
|
|
19
|
-
get io(): Server<import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any> | null;
|
|
20
16
|
AddWorker: (options: any) => Promise<string>;
|
|
21
17
|
DeleteWorker: (workerId: string, options: any) => Promise<JSONObject>;
|
|
22
18
|
ProcessTerminating: () => Promise<void>;
|
|
23
|
-
get expressServer(): STSExpressServer | null;
|
|
24
19
|
SetupServer: () => Promise<void>;
|
|
25
20
|
SetupServerEx: () => Promise<void>;
|
|
26
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerprocessbase.d.ts","sourceRoot":"","sources":["../src/workerprocessbase.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAS,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"workerprocessbase.d.ts","sourceRoot":"","sources":["../src/workerprocessbase.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAS,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAA;AAchE,OAAO,EAAiE,kBAAkB,EAAmB,MAAM,eAAe,CAAA;AAMlI,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAIvD;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,iBAAkB,YAAW,kBAAkB;;gBAKtE,OAAO,EAAE,cAAc;IAInC,aAAa;IAKb,yBAAyB,CAAC,GAAG,EAAE,GAAG;IAIzB,0BAA0B,IAAI,IAAI;IAwC3C,SAAS,YAAmB,GAAG,KAAG,QAAQ,MAAM,CAAC,CAUhD;IAGD,YAAY,aAAoB,MAAM,WAAW,GAAG,KAAG,QAAQ,UAAU,CAAC,CAWzE;IAED,kBAAkB,QAAa,QAAQ,IAAI,CAAC,CAE3C;IAED,WAAW,sBAMV;IAED,aAAa,sBAmEX;CACL"}
|