repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply dependencies update
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
selection-strategies-types.ts
diff --git
a/src/pools/selection-strategies/selection-strategies-types.ts
b/src/pools/selection-strategies/selection-strategies-types.ts
index 4d302f3defb1e7d5619d37693daf4104c944f377..3e7c3427e84f7bedb015e8f6d7ef54215377bd40 100644
(file)
--- a/
src/pools/selection-strategies/selection-strategies-types.ts
+++ b/
src/pools/selection-strategies/selection-strategies-types.ts
@@
-1,4
+1,4
@@
-import type {
AbstractPoolWorker } from '../abstract-
pool-worker'
+import type {
IPoolWorker } from '../
pool-worker'
/**
* Enumeration of worker choice strategies.
/**
* Enumeration of worker choice strategies.
@@
-28,28
+28,32
@@
export const WorkerChoiceStrategies = Object.freeze({
export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
/**
export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
/**
- *
T
asks usage statistics requirements.
+ *
Pool t
asks usage statistics requirements.
*/
*/
-export
type RequiredStatistics =
{
+export
interface RequiredStatistics
{
runTime: boolean
}
/**
* Worker choice strategy interface.
*
runTime: boolean
}
/**
* Worker choice strategy interface.
*
- * @t
emplate Worker
Type of worker which manages the strategy.
+ * @t
ypeParam Worker -
Type of worker which manages the strategy.
*/
*/
-export interface IWorkerChoiceStrategy<Worker extends
Abstract
PoolWorker> {
+export interface IWorkerChoiceStrategy<Worker extends
I
PoolWorker> {
/**
* Is the pool attached to the strategy dynamic?.
*/
/**
* Is the pool attached to the strategy dynamic?.
*/
- isDynamicPool: boolean
+
readonly
isDynamicPool: boolean
/**
/**
- * Required tasks usage statistics.
+ * Required
pool
tasks usage statistics.
*/
*/
- requiredStatistics: RequiredStatistics
+ re
adonly re
quiredStatistics: RequiredStatistics
/**
/**
- *
Choose a worker in the pool
.
+ *
Resets strategy internals (counters, statistics, etc.)
.
*/
*/
- choose(): Worker
+ reset: () => boolean
+ /**
+ * Chooses a worker in the pool.
+ */
+ choose: () => Worker
}
}