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 9ecf56577f999f4d56a5474917d522f644993749..fa1c0ffefdf27e6996789cc444f44d81de9076fc 100644
(file)
--- a/
src/utility-types.ts
+++ b/
src/utility-types.ts
@@
-9,15
+9,15
@@
import type { IWorker, Task } from './pools/worker'
*/
export interface TaskError<Data = unknown> {
/**
*/
export interface TaskError<Data = unknown> {
/**
- *
Worker id
.
+ *
Task name triggering the error
.
*/
*/
- readonly
workerId: number
+ readonly
name: string
/**
* Error message.
*/
readonly message: string
/**
/**
* Error message.
*/
readonly message: string
/**
- * Data
passed to the worker
triggering the error.
+ * Data triggering the error.
*/
readonly data?: Data
}
*/
readonly data?: Data
}
@@
-28,6
+28,10
@@
export interface TaskError<Data = unknown> {
* @internal
*/
export interface TaskPerformance {
* @internal
*/
export interface TaskPerformance {
+ /**
+ * Task name.
+ */
+ readonly name: string
/**
* Task performance timestamp.
*/
/**
* Task performance timestamp.
*/
@@
-61,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.
*/
@@
-82,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
}
/**
}
/**