repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chore: v2.6.21
[poolifier.git]
/
src
/
pools
/
worker.ts
diff --git
a/src/pools/worker.ts
b/src/pools/worker.ts
index 58610eaaddacc2beea93809f80675bb8530010c0..2da91457aed58994f01714a162adffba69ab61fe 100644
(file)
--- a/
src/pools/worker.ts
+++ b/
src/pools/worker.ts
@@
-1,3
+1,4
@@
+import type { MessageChannel } from 'node:worker_threads'
import type { CircularArray } from '../circular-array'
import type { Task } from '../utility-types'
import type { CircularArray } from '../circular-array'
import type { Task } from '../utility-types'
@@
-105,8
+106,8
@@
export interface TaskStatistics {
* Enumeration of worker types.
*/
export const WorkerTypes = Object.freeze({
* Enumeration of worker types.
*/
export const WorkerTypes = Object.freeze({
-
cluster: 'cluster
',
-
thread: 'thread
'
+
thread: 'thread
',
+
cluster: 'cluster
'
} as const)
/**
} as const)
/**
@@
-136,6
+137,10
@@
export interface WorkerInfo {
* Ready flag.
*/
ready: boolean
* Ready flag.
*/
ready: boolean
+ /**
+ * Message channel.
+ */
+ messageChannel?: MessageChannel
}
/**
}
/**
@@
-238,7
+243,11
@@
export interface IWorkerNode<Worker extends IWorker, Data = unknown> {
*/
readonly resetUsage: () => void
/**
*/
readonly resetUsage: () => void
/**
- * Gets task usage statistics.
+ * Close communication channel.
+ */
+ readonly closeChannel: () => void
+ /**
+ * Gets task worker usage statistics.
*/
readonly getTaskWorkerUsage: (name: string) => WorkerUsage | undefined
}
*/
readonly getTaskWorkerUsage: (name: string) => WorkerUsage | undefined
}