repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
docs: refine code comment
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
interleaved-weighted-round-robin-worker-choice-strategy.ts
diff --git
a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
index 9c863b56f980bffe9f2eb6b86244bb3ad1573033..8ccb5f7890db974d91cd24b2b247a2a04f2ce67c 100644
(file)
--- a/
src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
+++ b/
src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
@@
-1,14
+1,11
@@
import type { IWorker } from '../worker'
import type { IPool } from '../pool'
import type { IWorker } from '../worker'
import type { IPool } from '../pool'
-import {
- DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
- DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
-} from '../../utils'
+import { DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS } from '../../utils'
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
import type {
IWorkerChoiceStrategy,
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
import type {
IWorkerChoiceStrategy,
-
TaskStatisticsRequirement
s,
-
WorkerChoiceStrategyOption
s
+
InternalWorkerChoiceStrategyOption
s,
+
TaskStatisticsRequirement
s
} from './selection-strategies-types'
/**
} from './selection-strategies-types'
/**
@@
-60,7
+57,7
@@
export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
/** @inheritDoc */
public constructor (
pool: IPool<Worker, Data, Response>,
/** @inheritDoc */
public constructor (
pool: IPool<Worker, Data, Response>,
- opts:
WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+ opts:
InternalWorkerChoiceStrategyOptions
) {
super(pool, opts)
this.setTaskStatisticsRequirements(this.opts)
) {
super(pool, opts)
this.setTaskStatisticsRequirements(this.opts)
@@
-157,7
+154,7
@@
export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
}
/** @inheritDoc */
}
/** @inheritDoc */
- public setOptions (opts: WorkerChoiceStrategyOptions): void {
+ public setOptions (opts:
Internal
WorkerChoiceStrategyOptions): void {
super.setOptions(opts)
this.roundWeights = this.getRoundWeights()
}
super.setOptions(opts)
this.roundWeights = this.getRoundWeights()
}
@@
-170,7
+167,7
@@
export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
...new Set(
Object.values(this.opts.weights)
.slice()
...new Set(
Object.values(this.opts.weights)
.slice()
- .sort((a, b) =>
b - a
)
+ .sort((a, b) =>
a - b
)
)
]
}
)
]
}