X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fabstract-worker-choice-strategy.ts;h=aa370fe433e74065e4155d8612499abef5ec59fb;hb=9cd39dd47830f0923cd3ebf53b709bf7fb07e788;hp=5b526331824be72af5048eb8c76fe26b001a373a;hpb=c923ce5670eeae4194aa996d44a1071e88cb21ad;p=poolifier.git diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index 5b526331..aa370fe4 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -7,7 +7,7 @@ import type { } from './selection-strategies-types' /** - * Abstract worker choice strategy class. + * Worker choice strategy abstract base class. * * @typeParam Worker - Type of worker which manages the strategy. * @typeParam Data - Type of data sent to the worker. This can only be serializable data. @@ -22,7 +22,8 @@ export abstract class AbstractWorkerChoiceStrategy< public readonly isDynamicPool: boolean /** {@inheritDoc} */ public requiredStatistics: RequiredStatistics = { - runTime: false + runTime: false, + avgRunTime: false } /** @@ -34,6 +35,7 @@ export abstract class AbstractWorkerChoiceStrategy< protected readonly pool: IPoolInternal ) { this.isDynamicPool = this.pool.type === PoolType.DYNAMIC + this.choose.bind(this) } /** {@inheritDoc} */ @@ -41,4 +43,7 @@ export abstract class AbstractWorkerChoiceStrategy< /** {@inheritDoc} */ public abstract choose (): number + + /** {@inheritDoc} */ + public abstract remove (workerKey: number): boolean }