repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: remove unused queue code
[poolifier.git]
/
src
/
pools
/
pool.ts
diff --git
a/src/pools/pool.ts
b/src/pools/pool.ts
index c7b878ae05814dec641298ca1630633ebc93b4b9..d80ddd7b2cb810c987c64dbcc40338d3b89735ab 100644
(file)
--- a/
src/pools/pool.ts
+++ b/
src/pools/pool.ts
@@
-79,6
+79,7
@@
export interface PoolInfo {
readonly executingTasks: number
readonly queuedTasks?: number
readonly maxQueuedTasks?: number
readonly executingTasks: number
readonly queuedTasks?: number
readonly maxQueuedTasks?: number
+ readonly backPressure?: boolean
readonly failedTasks: number
readonly runTime?: {
readonly minimum: number
readonly failedTasks: number
readonly runTime?: {
readonly minimum: number
@@
-95,11
+96,17
@@
export interface PoolInfo {
}
/**
}
/**
- * Worker tasks queue options.
+ * Worker
node
tasks queue options.
*/
export interface TasksQueueOptions {
/**
*/
export interface TasksQueueOptions {
/**
- * Maximum number of tasks that can be executed concurrently on a worker.
+ * Maximum tasks queue size per worker node flagging it as back pressured.
+ *
+ * @defaultValue (pool maximum size)^2
+ */
+ readonly queueMaxSize?: number
+ /**
+ * Maximum number of tasks that can be executed concurrently on a worker node.
*
* @defaultValue 1
*/
*
* @defaultValue 1
*/
@@
-149,13
+156,13
@@
export interface PoolOptions<Worker extends IWorker> {
*/
enableEvents?: boolean
/**
*/
enableEvents?: boolean
/**
- * Pool worker tasks queue.
+ * Pool worker
node
tasks queue.
*
* @defaultValue false
*/
enableTasksQueue?: boolean
/**
*
* @defaultValue false
*/
enableTasksQueue?: boolean
/**
- * Pool worker tasks queue options.
+ * Pool worker
node
tasks queue options.
*/
tasksQueueOptions?: TasksQueueOptions
}
*/
tasksQueueOptions?: TasksQueueOptions
}
@@
-201,7
+208,7
@@
export interface IPool<
* - '`destroy`': Emitted when the pool is destroyed.
* - `'error'`: Emitted when an uncaught error occurs.
* - `'taskError'`: Emitted when an error occurs while executing a task.
* - '`destroy`': Emitted when the pool is destroyed.
* - `'error'`: Emitted when an uncaught error occurs.
* - `'taskError'`: Emitted when an error occurs while executing a task.
- * - `'backPressure'`: Emitted when a
worker node has back pressure (i.e. its tasks queue is full
).
+ * - `'backPressure'`: Emitted when a
ll worker nodes have back pressure (i.e. their tasks queue is full: queue size \>= maximum queue size
).
*/
readonly emitter?: PoolEmitter
/**
*/
readonly emitter?: PoolEmitter
/**
@@
-246,19
+253,19
@@
export interface IPool<
workerChoiceStrategyOptions: WorkerChoiceStrategyOptions
) => void
/**
workerChoiceStrategyOptions: WorkerChoiceStrategyOptions
) => void
/**
- * Enables/disables the worker tasks queue in this pool.
+ * Enables/disables the worker
node
tasks queue in this pool.
*
*
- * @param enable - Whether to enable or disable the worker tasks queue.
- * @param tasksQueueOptions - The worker tasks queue options.
+ * @param enable - Whether to enable or disable the worker
node
tasks queue.
+ * @param tasksQueueOptions - The worker
node
tasks queue options.
*/
readonly enableTasksQueue: (
enable: boolean,
tasksQueueOptions?: TasksQueueOptions
) => void
/**
*/
readonly enableTasksQueue: (
enable: boolean,
tasksQueueOptions?: TasksQueueOptions
) => void
/**
- * Sets the worker tasks queue options in this pool.
+ * Sets the worker
node
tasks queue options in this pool.
*
*
- * @param tasksQueueOptions - The worker tasks queue options.
+ * @param tasksQueueOptions - The worker
node
tasks queue options.
*/
readonly setTasksQueueOptions: (tasksQueueOptions: TasksQueueOptions) => void
}
*/
readonly setTasksQueueOptions: (tasksQueueOptions: TasksQueueOptions) => void
}