repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perf: optimize worker node lookup by worker id
[poolifier.git]
/
src
/
pools
/
worker.ts
diff --git
a/src/pools/worker.ts
b/src/pools/worker.ts
index 507396dea078ac806c5dda839336f6046df11d5c..f1c29b3659a3c1c9da5569fe3f008fe70cfd78df 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'
@@
-136,6
+137,10
@@
export interface WorkerInfo {
* Ready flag.
*/
ready: boolean
* Ready flag.
*/
ready: boolean
+ /**
+ * Message channel.
+ */
+ messageChannel?: MessageChannel
}
/**
}
/**
@@
-237,6
+242,10
@@
export interface IWorkerNode<Worker extends IWorker, Data = unknown> {
* Resets usage statistics .
*/
readonly resetUsage: () => void
* Resets usage statistics .
*/
readonly resetUsage: () => void
+ /**
+ * Close communication channel.
+ */
+ readonly closeChannel: () => void
/**
* Gets task worker usage statistics.
*/
/**
* Gets task worker usage statistics.
*/