repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:poolifier/poolifier
[poolifier.git]
/
src
/
utility-types.ts
diff --git
a/src/utility-types.ts
b/src/utility-types.ts
index 0443b4ceef2374e28ba8201bf5d1d6a61ebbce93..fa1c0ffefdf27e6996789cc444f44d81de9076fc 100644
(file)
--- a/
src/utility-types.ts
+++ b/
src/utility-types.ts
@@
-8,36
+8,48
@@
import type { IWorker, Task } from './pools/worker'
* @typeParam Data - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
*/
export interface TaskError<Data = unknown> {
* @typeParam Data - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
*/
export interface TaskError<Data = unknown> {
+ /**
+ * Task name triggering the error.
+ */
+ readonly name: string
/**
* Error message.
*/
/**
* Error message.
*/
- message: string
+
readonly
message: string
/**
/**
- * Data
passed to the worker
triggering the error.
+ * Data triggering the error.
*/
*/
- data?: Data
+
readonly
data?: Data
}
/**
* Task performance.
}
/**
* Task performance.
+ *
+ * @internal
*/
export interface TaskPerformance {
*/
export interface TaskPerformance {
+ /**
+ * Task name.
+ */
+ readonly name: string
/**
* Task performance timestamp.
*/
/**
* Task performance timestamp.
*/
- timestamp: number
+
readonly
timestamp: number
/**
* Task runtime.
*/
/**
* Task runtime.
*/
- runTime?: number
+ r
eadonly r
unTime?: number
/**
* Task event loop utilization.
*/
/**
* Task event loop utilization.
*/
- elu?: EventLoopUtilization
+
readonly
elu?: EventLoopUtilization
}
/**
* Performance statistics computation.
}
/**
* Performance statistics computation.
+ *
+ * @internal
*/
export interface WorkerStatistics {
runTime: boolean
*/
export interface WorkerStatistics {
runTime: boolean
@@
-53,14
+65,10
@@
export interface WorkerStatistics {
*/
export interface MessageValue<Data = unknown, ErrorData = unknown>
extends Task<Data> {
*/
export interface MessageValue<Data = unknown, ErrorData = unknown>
extends Task<Data> {
- /**
- * Worker id.
- */
- readonly workerId?: number
/**
* Kill code.
*/
/**
* Kill code.
*/
- readonly kill?: KillBehavior |
1
+ readonly kill?: KillBehavior |
true
/**
* Task error.
*/
/**
* Task error.
*/
@@
-74,9
+82,13
@@
export interface MessageValue<Data = unknown, ErrorData = unknown>
*/
readonly statistics?: WorkerStatistics
/**
*/
readonly statistics?: WorkerStatistics
/**
- * Whether the worker has started or not.
+ * Whether the worker is ready or not.
+ */
+ readonly ready?: boolean
+ /**
+ * Whether the worker starts or stops its aliveness check.
*/
*/
- readonly
started
?: boolean
+ readonly
checkAlive
?: boolean
}
/**
}
/**