repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 1.1.10
[e-mobility-charging-stations-simulator.git]
/
src
/
types
/
Worker.ts
diff --git
a/src/types/Worker.ts
b/src/types/Worker.ts
index bc2972684c0cb2677f34176ffbd11b119392d423..8f47f57818e6e8b968bc10dce0c5bc21552df56e 100644
(file)
--- a/
src/types/Worker.ts
+++ b/
src/types/Worker.ts
@@
-1,3
+1,4
@@
+import { PoolOptions } from 'poolifier';
import { Worker } from 'worker_threads';
export enum WorkerProcessType {
import { Worker } from 'worker_threads';
export enum WorkerProcessType {
@@
-7,24
+8,29
@@
export enum WorkerProcessType {
}
export interface WorkerOptions {
}
export interface WorkerOptions {
+ startDelay?: number;
poolMaxSize?: number;
poolMinSize?: number;
elementsPerWorker?: number;
poolMaxSize?: number;
poolMinSize?: number;
elementsPerWorker?: number;
+ poolOptions?: PoolOptions<Worker>;
+ messageHandler?: (message: unknown) => void | Promise<void>;
}
}
-export interface WorkerData { }
+// eslint-disable-next-line @typescript-eslint/no-empty-interface
+export interface WorkerData {}
-export interface
StationWorkerData extends WorkerData
{
-
index: numb
er;
-
templateFile: string
;
+export interface
WorkerSetElement
{
+
worker: Work
er;
+
numberOfWorkerElements: number
;
}
}
-export interface Worker
SetElement
{
- worker: Worker,
- numberOfWorkerElements: number
+export interface Worker
Message
{
+ id: WorkerMessageEvents;
+ data: any;
}
}
-export enum WorkerEvents {
+export enum Worker
Message
Events {
START_WORKER_ELEMENT = 'startWorkerElement',
START_WORKER_ELEMENT = 'startWorkerElement',
+ STOP_WORKER_ELEMENT = 'stopWorkerElement'
}
}