repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: add worker info to worker nodes
[poolifier.git]
/
src
/
pools
/
worker.ts
diff --git
a/src/pools/worker.ts
b/src/pools/worker.ts
index 07eabdfe4b43d28a7ecc1238b6f422be04d83ef1..c92478d4a8436512853384f65ccce026f6528a19 100644
(file)
--- a/
src/pools/worker.ts
+++ b/
src/pools/worker.ts
@@
-118,6
+118,22
@@
export interface TaskStatistics {
failed: number
}
failed: number
}
+/**
+ * Worker information.
+ *
+ * @internal
+ */
+export interface WorkerInfo {
+ /**
+ * Worker Id.
+ */
+ id: number | undefined
+ /**
+ * Started flag.
+ */
+ started: boolean
+}
+
/**
* Worker usage statistics.
*
/**
* Worker usage statistics.
*
@@
-146,6
+162,11
@@
export interface WorkerUsage {
* Worker interface.
*/
export interface IWorker {
* Worker interface.
*/
export interface IWorker {
+ /**
+ * Worker Id.
+ */
+ id?: number
+ threadId?: number
/**
* Register an event listener.
*
/**
* Register an event listener.
*
@@
-177,10
+198,14
@@
export interface WorkerNode<Worker extends IWorker, Data = unknown> {
* Worker node worker.
*/
readonly worker: Worker
* Worker node worker.
*/
readonly worker: Worker
+ /**
+ * Worker node worker info.
+ */
+ info: WorkerInfo
/**
* Worker node worker usage statistics.
*/
/**
* Worker node worker usage statistics.
*/
-
workerU
sage: WorkerUsage
+
u
sage: WorkerUsage
/**
* Worker node tasks queue.
*/
/**
* Worker node tasks queue.
*/